File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11
11
* @module @ember -data/request/fetch
12
12
* @main @ember -data/request/fetch
13
13
*/
14
- import { getOwnConfig , macroCondition } from '@embroider/macros' ;
14
+
15
+ import { DEBUG } from '@ember-data/env' ;
15
16
16
17
import { cloneResponseProperties , type Context } from './-private/context' ;
17
18
import type { HttpErrorProps } from './-private/utils' ;
@@ -34,9 +35,13 @@ function cloneResponse(response: Response, overrides: Partial<Response>) {
34
35
}
35
36
36
37
let IS_MAYBE_MIRAGE = ( ) => false ;
37
- if ( macroCondition ( getOwnConfig < { env : { TESTING : boolean } } > ( ) . env . TESTING ) ) {
38
+ if ( DEBUG ) {
38
39
IS_MAYBE_MIRAGE = ( ) =>
39
- Boolean ( typeof window !== 'undefined' && ( window as { server ?: { pretender : unknown } } ) . server ?. pretender ) ;
40
+ Boolean (
41
+ typeof window !== 'undefined' &&
42
+ ( ( window as { server ?: { pretender : unknown } } ) . server ?. pretender ||
43
+ window . fetch . toString ( ) !== 'function fetch() { [native code] }' )
44
+ ) ;
40
45
}
41
46
42
47
const MUTATION_OPS = new Set ( [ 'updateRecord' , 'createRecord' , 'deleteRecord' ] ) ;
You can’t perform that action at this time.
0 commit comments