Removing automatically reset modules between test run

Reviewed By: bestander

Differential Revision: D3886125

fbshipit-source-id: c8f47c3466add1e2c89649a1c6f47b01f0d7a89e
This commit is contained in:
Cristian Carlesso
2016-09-19 12:30:50 -07:00
committed by Facebook Github Bot 3
parent d41c3950eb
commit 7b2080e118
9 changed files with 717 additions and 657 deletions

View File

@@ -1,3 +1,12 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
jest.autoMockOff();
@@ -6,7 +15,9 @@ const getProjectDependencies = require('../getProjectDependencies');
const path = require('path');
describe('getProjectDependencies', () => {
beforeEach(() => {
jest.resetModules();
});
it('should return an array of project dependencies', () => {
jest.setMock(
path.join(process.cwd(), './package.json'),

View File

@@ -21,6 +21,7 @@ jest.setMock(
describe('link', () => {
beforeEach(() => {
jest.resetModules();
delete require.cache[require.resolve('../link')];
log.level = 'silent';
});