File tree 2 files changed +7
-3
lines changed
packages/jest-resolve/src
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
### Fixes
4
4
5
+ * ` [jest-resolve] ` Use ` module.builtinModules ` as ` BUILTIN_MODULES ` when it exists
5
6
* ` [jest-worker] ` Remove ` debug ` and ` inspect ` flags from the arguments sent to
6
7
the child ([ #5068 ] ( https://github.com/facebook/jest/pull/5068 ) )
7
8
* ` [jest-config] ` Use all ` --testPathPattern ` and ` <regexForTestFiles> ` args in
Original file line number Diff line number Diff line change @@ -12,10 +12,13 @@ declare var process: {
12
12
binding ( type : string ) : { } ,
13
13
} ;
14
14
15
- const BUILTIN_MODULES = Object . keys ( process . binding ( 'natives' ) ) . filter (
16
- ( module : string ) => ! / ^ i n t e r n a l \/ / . test ( module ) ,
17
- ) ;
15
+ const BUILTIN_MODULES =
16
+ module . builtinModules ||
17
+ Object . keys ( process . binding ( 'natives' ) ) . filter (
18
+ ( module : string ) => ! / ^ i n t e r n a l \/ / . test ( module ) ,
19
+ ) ;
18
20
19
21
export default function isBuiltinModule ( module : string ) : boolean {
22
+ // $FlowFixMe: module.builtinModules is not added to the flow type definitions yet
20
23
return BUILTIN_MODULES . indexOf ( module ) !== - 1 ;
21
24
}
You can’t perform that action at this time.
0 commit comments