Properly mock `path` in DependencyGraph-test

Reviewed By: jeanlauliac

Differential Revision: D5111337

fbshipit-source-id: ceca2ec8917eda9ca34d65324d8b8c2a468eed1c
This commit is contained in:
Christoph Pojer 2017-05-23 05:06:16 -07:00 committed by Facebook Github Bot
parent 4f980eedbd
commit 657ea49bd6
1 changed files with 2 additions and 4 deletions

View File

@ -30,11 +30,9 @@ jest.mock(
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
const path = require('path');
beforeEach(() => {
jest.resetModules();
jest.mock('path', () => path);
jest.mock('path', () => require.requireActual('path'));
});
describe('DependencyGraph', function() {
@ -2522,7 +2520,7 @@ describe('DependencyGraph', function() {
// reload path module
jest.resetModules();
jest.mock('path', () => path.win32);
jest.mock('path', () => require.requireActual('path').win32);
DependencyGraph = require('../DependencyGraph');
});