-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
Disable timer mocking and enable verbose output.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// 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(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gaearon
Author
Contributor
|
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ module.exports = (resolve, rootDir) => { | |
setupFiles: [ | ||
resolve('config/polyfills.js') | ||
], | ||
testEnvironment: 'node' | ||
setupTestFrameworkScriptFile: resolve('config/jest/environment.js'), | ||
This comment has been minimized.
Sorry, something went wrong.
cpojer
Contributor
|
||
testEnvironment: 'node', | ||
verbose: true | ||
}; | ||
if (rootDir) { | ||
config.rootDir = rootDir; | ||
|
You don't need to do this in beforeEach. It should be enough to do this in this file and call it just once.
I'll make an option for this for Jest 15 so we can remove this.