Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Revert require.cache busting #482

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/jest/base-jest-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function getReactSetup() {
const reactSetup = getReactSetup();

module.exports = {
cache: false,
coverageDirectory: `${process.cwd()}/coverage`,
coverageReporters: ['json'],
rootDir: process.cwd(),
Expand Down
8 changes: 6 additions & 2 deletions build/jest/jest-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const baseJestConfig = require('./base-jest-config.js');
const projects = process.env.JEST_ENV.split(',');

let config = {
cache: false,
coverageDirectory: `${process.cwd()}/coverage`,
// collectCoverageFrom doesn't work from project config,
// must be set at top-level
Expand All @@ -25,7 +24,12 @@ let config = {
// Use projects if we have more than one environment.
if (projects.length > 1) {
// $FlowFixMe
config.projects = projects.map(project => `<rootDir>/${project}`);
config.projects = projects.map(project => {
return {
// $FlowFixMe
...require(`./${project === 'jsdom' ? 'jsdom' : 'node'}/jest.config.js`),
};
});
} else {
config = {
// $FlowFixMe
Expand Down
6 changes: 0 additions & 6 deletions build/jest/jest-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@

/* eslint-env node */

// Clear require cache before each run to reset file exports between environment runs.
// Currently the transformer seems like the most robust place to clear cache.
const clearModule = require('clear-module');

clearModule.all();

const loadFusionRC = require('../load-fusionrc.js');

const babelConfig = require('../babel-preset.js')(null, {
Expand Down