mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 05:15:49 +08:00
Removing automatically reset modules between test run
Reviewed By: bestander Differential Revision: D3886125 fbshipit-source-id: c8f47c3466add1e2c89649a1c6f47b01f0d7a89e
This commit is contained in:
committed by
Facebook Github Bot 3
parent
d41c3950eb
commit
7b2080e118
@@ -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'),
|
||||
|
||||
@@ -21,6 +21,7 @@ jest.setMock(
|
||||
|
||||
describe('link', () => {
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
delete require.cache[require.resolve('../link')];
|
||||
log.level = 'silent';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user