File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
packages/jest-resolve/src Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1818* ` [docs] ` Add tutorial page for ES6 class mocks.
1919 ([ #5383 ] https://github.com/facebook/jest/pull/5383 ))
2020* ` [jest-resolve] ` Search required modules in node_modules and then in custom
21- paths.
22- ([ #5403 ] ( https://github.com/facebook/jest/pull/5403 ) )
21+ paths. ([ #5403 ] ( https://github.com/facebook/jest/pull/5403 ) )
22+ * ` [jest-resolve] ` Get builtin modules from node core.
23+ ([ #5411 ] ( https://github.com/facebook/jest/pull/5411 ) )
2324
2425## jest 22.1.4
2526
@@ -1493,4 +1494,4 @@ See https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html
14931494
14941495## <=0.4.0
14951496
1496- * See commit history for changes in previous versions of jest.
1497+ * See commit history for changes in previous versions of jest.
Original file line number Diff line number Diff line change 77 * @flow
88 */
99
10+ // $FlowFixMe: Flow doesn't know about the `module` module
11+ import { builtinModules } from 'module' ;
12+
1013// https://github.com/facebook/flow/pull/5160
1114declare var process: {
1215 binding ( type : string ) : { } ,
1316} ;
1417
1518const BUILTIN_MODULES =
16- module . builtinModules ||
19+ builtinModules ||
1720 Object . keys ( process . binding ( 'natives' ) ) . filter (
1821 ( module : string ) => ! / ^ i n t e r n a l \/ / . test ( module ) ,
1922 ) ;
2023
2124export default function isBuiltinModule ( module : string ) : boolean {
22- // $FlowFixMe: module.builtinModules is not added to the flow type definitions yet
2325 return BUILTIN_MODULES . indexOf ( module ) !== - 1 ;
2426}
You can’t perform that action at this time.
0 commit comments