From 657ea49bd602acc881ae9cd8d910181154533f00 Mon Sep 17 00:00:00 2001 From: Christoph Pojer Date: Tue, 23 May 2017 05:06:16 -0700 Subject: [PATCH] Properly mock `path` in DependencyGraph-test Reviewed By: jeanlauliac Differential Revision: D5111337 fbshipit-source-id: ceca2ec8917eda9ca34d65324d8b8c2a468eed1c --- packager/src/node-haste/__tests__/DependencyGraph-test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packager/src/node-haste/__tests__/DependencyGraph-test.js b/packager/src/node-haste/__tests__/DependencyGraph-test.js index 0a3938b6a..3ac36cf5e 100644 --- a/packager/src/node-haste/__tests__/DependencyGraph-test.js +++ b/packager/src/node-haste/__tests__/DependencyGraph-test.js @@ -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'); });