metro-bundler: fix DependencyGraph-test

Reviewed By: mjesun

Differential Revision: D5371267

fbshipit-source-id: 689f7c5b2920cb15d7ba6c50c34a94344b2a686b
This commit is contained in:
Jean Lauliac 2017-07-07 03:19:52 -07:00 committed by Facebook Github Bot
parent 7111cf6e4e
commit 7450484d94
1 changed files with 6 additions and 2 deletions

View File

@ -17,7 +17,11 @@ jest
.mock('../../Logger')
.mock('../../lib/TransformCaching')
// It's noticeably faster to prevent running watchman from FileWatcher.
.mock('child_process', () => ({}));
.mock('child_process', () => ({}))
.mock('os', () => ({
...require.requireActual('os'),
platform: () => 'test',
}));
// This doesn't have state, and it's huge (Babel) so it's much faster to
// require it only once. The variable name is prefixed with "mock" as an escape-hatch
@ -1047,7 +1051,7 @@ describe('DependencyGraph', function() {
root: {
'index.js': ['/**', ' * @providesModule index', ' */'].join('\n'),
aPackage: {
'package.json': 'lol',
'package.json': '{}',
'main.js': 'lol',
},
},