Commit 8084a326 authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Tweak Jest default settings (#378)

Disable timer mocking and enable verbose output.
parent 6fb517a3
No related merge requests found
Showing with 11 additions and 1 deletion
+11 -1
// Currently, Jest mocks setTimeout() and similar functions by default:
// https://facebook.github.io/jest/docs/timer-mocks.html
// We think this is confusing, so we disable this feature.
// If you see value in it, run `jest.useFakeTimers()` in individual tests.
beforeEach(() => {
jest.useRealTimers();
});
...@@ -41,6 +41,7 @@ prompt( ...@@ -41,6 +41,7 @@ prompt(
path.join('config', 'webpack.config.prod.js'), path.join('config', 'webpack.config.prod.js'),
path.join('config', 'jest', 'CSSStub.js'), path.join('config', 'jest', 'CSSStub.js'),
path.join('config', 'jest', 'FileStub.js'), path.join('config', 'jest', 'FileStub.js'),
path.join('config', 'jest', 'environment.js'),
path.join('config', 'jest', 'transform.js'), path.join('config', 'jest', 'transform.js'),
path.join('scripts', 'build.js'), path.join('scripts', 'build.js'),
path.join('scripts', 'start.js'), path.join('scripts', 'start.js'),
......
...@@ -19,7 +19,9 @@ module.exports = (resolve, rootDir) => { ...@@ -19,7 +19,9 @@ module.exports = (resolve, rootDir) => {
setupFiles: [ setupFiles: [
resolve('config/polyfills.js') resolve('config/polyfills.js')
], ],
testEnvironment: 'node' setupTestFrameworkScriptFile: resolve('config/jest/environment.js'),
testEnvironment: 'node',
verbose: true
}; };
if (rootDir) { if (rootDir) {
config.rootDir = rootDir; config.rootDir = rootDir;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment