mirror of https://github.com/status-im/metro.git
metro-bundler: fix DependencyGraph-test
Reviewed By: cpojer Differential Revision: D5227270 fbshipit-source-id: 3d36394cafa658070d84d7b5ace2af48d20cc9d7
This commit is contained in:
parent
62bbacafb5
commit
5bae61e611
|
@ -13,6 +13,7 @@
|
|||
jest.useRealTimers();
|
||||
jest
|
||||
.mock('fs')
|
||||
.mock('graceful-fs')
|
||||
.mock('../../Logger')
|
||||
.mock('../../lib/TransformCaching')
|
||||
// It's noticeably faster to prevent running watchman from FileWatcher.
|
||||
|
@ -31,6 +32,8 @@ jest.mock('../../JSTransformer/worker/extract-dependencies', () => {
|
|||
return mockExtractDependencies;
|
||||
});
|
||||
|
||||
jest.mock('graceful-fs', () => require('fs'));
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -5804,7 +5807,7 @@ describe('DependencyGraph', function() {
|
|||
}
|
||||
|
||||
function setMockFileSystem(object) {
|
||||
return require('graceful-fs').__setMockFilesystem(object);
|
||||
return require('fs').__setMockFilesystem(object);
|
||||
}
|
||||
|
||||
function triggerAndProcessWatchEvent(dgraphPromise, eventType, filename) {
|
||||
|
@ -5818,6 +5821,6 @@ describe('DependencyGraph', function() {
|
|||
}
|
||||
|
||||
function triggerWatchEvent(eventType, filename) {
|
||||
return require('graceful-fs').__triggerWatchEvent(eventType, filename);
|
||||
return require('fs').__triggerWatchEvent(eventType, filename);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue