-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade jest #1892
base: master
Are you sure you want to change the base?
Upgrade jest #1892
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
require('airbnb-js-shims/target/es2019'); | ||
|
||
const { TextEncoder, TextDecoder } = require('util'); | ||
|
||
global.TextEncoder = TextEncoder; | ||
global.TextDecoder = TextDecoder; | ||
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,4 @@ | ||||||||
/** @type {import('jest').Config} */ | ||||||||
module.exports = { | ||||||||
bail: false, | ||||||||
collectCoverageFrom: [ | ||||||||
|
@@ -39,8 +40,13 @@ module.exports = { | |||||||
setupFiles: ['<rootDir>/config-jest/setup/shims.js', '<rootDir>/config-jest/setup/console.js'], | ||||||||
setupFilesAfterEnv: ['<rootDir>/config-jest/setup/enzyme.js'], | ||||||||
testEnvironment: 'jsdom', | ||||||||
testURL: 'http://localhost', | ||||||||
timers: 'fake', | ||||||||
testEnvironmentOptions: { | ||||||||
url: 'http://localhost', | ||||||||
}, | ||||||||
fakeTimers: { | ||||||||
enableGlobally: true, | ||||||||
legacyFakeTimers: true, | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is only a single test that fails when using the modern mock timers, but it wasn't immediately obvious how to fix this (probably just
failed with
There is another test referencing fake timers, so that one should be revisited as well when switching from legacy to modern fake timers: visx/packages/visx-responsive/test/useScreenSize.test.ts Lines 36 to 37 in 0614604
|
||||||||
}, | ||||||||
verbose: false, | ||||||||
testPathIgnorePatterns: ['<rootDir>/packages/visx-demo'], | ||||||||
transformIgnorePatterns: [ | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had to add this because
jest-environment-jsdom
does not containTextEncoder
andTextDecorder
, butreact
requires them.