File tree 2 files changed +6
-6
lines changed
packages/jest-runtime/src
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -329,9 +329,9 @@ class Runtime {
329
329
loaded : false ,
330
330
} ;
331
331
moduleRegistry [ modulePath ] = localModule ;
332
- if ( path . extname ( modulePath ) === '.json' ) {
332
+ if ( path . extname ( modulePath . split ( '?' ) [ 0 ] ) === '.json' ) {
333
333
localModule . exports = this . _environment . global . JSON . parse (
334
- stripBOM ( fs . readFileSync ( modulePath , 'utf8' ) ) ,
334
+ stripBOM ( fs . readFileSync ( modulePath . split ( '?' ) [ 0 ] , 'utf8' ) ) ,
335
335
) ;
336
336
} else if (path.extname(modulePath) === '.node') {
337
337
// $FlowFixMe
@@ -391,7 +391,7 @@ class Runtime {
391
391
'__mocks__' ,
392
392
moduleFileName ,
393
393
) ;
394
- if ( fs . existsSync ( potentialManualMock ) ) {
394
+ if ( fs . existsSync ( potentialManualMock . split ( '?' ) [ 0 ] ) ) {
395
395
manualMock = true ;
396
396
modulePath = potentialManualMock ;
397
397
}
@@ -472,7 +472,7 @@ class Runtime {
472
472
if (
473
473
coveredFiles . has ( sourcePath ) &&
474
474
this . _needsCoverageMapped . has ( sourcePath ) &&
475
- fs . existsSync ( this . _sourceMapRegistry [ sourcePath ] )
475
+ fs . existsSync ( this . _sourceMapRegistry [ sourcePath ] . split ( '?' ) [ 0 ] )
476
476
) {
477
477
result [ sourcePath ] = this . _sourceMapRegistry [ sourcePath ] ;
478
478
}
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export default class ScriptTransformer {
292
292
const isInternalModule = ! ! ( options && options . isInternalModule ) ;
293
293
const isCoreModule = ! ! ( options && options . isCoreModule ) ;
294
294
const content = stripShebang (
295
- fileSource || fs . readFileSync ( filename , 'utf8' ) ,
295
+ fileSource || fs . readFileSync ( filename . split ( '?' ) [ 0 ] , 'utf8' ) ,
296
296
) ;
297
297
298
298
let wrappedCode : string ;
@@ -502,7 +502,7 @@ const readCacheFile = (cachePath: Path): ?string => {
502
502
} ;
503
503
504
504
const getScriptCacheKey = ( filename , instrument : boolean ) => {
505
- const mtime = fs . statSync ( filename ) . mtime ;
505
+ const mtime = fs . statSync ( filename . split ( '?' ) [ 0 ] ) . mtime ;
506
506
return filename + '_' + mtime . getTime ( ) + ( instrument ? '_instrumented' : '' ) ;
507
507
} ;
508
508
You can’t perform that action at this time.
0 commit comments