-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
chore: upgrade to jest 24 #15778
chore: upgrade to jest 24 #15778
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 |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
"archiver": "^3.0.0", | ||
"babel-core": "^7.0.0-bridge", | ||
"babel-eslint": "^9.0.0", | ||
"babel-jest": "^24.7.1", | ||
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. these are just remnants after migrating it into this monorepo, I guess? They're unused |
||
"babel-loader": "^8.0.4", | ||
"chrome-launch": "^1.1.4", | ||
"child-process-promise": "^2.2.1", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,7 +160,7 @@ describe('ReactTestRendererAsync', () => { | |
|
||
expect(() => | ||
expect(Scheduler).toFlushAndYieldThrough(['foo', 'baz']), | ||
).toThrow('Expected value to equal:'); | ||
).toThrow('// deep equality'); | ||
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. we've changed the error messages |
||
}); | ||
|
||
it('toFlushAndYield', () => { | ||
|
@@ -181,7 +181,7 @@ describe('ReactTestRendererAsync', () => { | |
); | ||
|
||
expect(() => expect(Scheduler).toFlushWithoutYielding()).toThrowError( | ||
'Expected value to equal:', | ||
'// deep equality', | ||
); | ||
|
||
renderer.update( | ||
|
@@ -193,7 +193,7 @@ describe('ReactTestRendererAsync', () => { | |
); | ||
|
||
expect(() => expect(Scheduler).toFlushAndYield(['foo', 'baz'])).toThrow( | ||
'Expected value to equal:', | ||
'// deep equality', | ||
); | ||
}); | ||
|
||
|
@@ -254,7 +254,7 @@ describe('ReactTestRendererAsync', () => { | |
|
||
ReactTestRenderer.create(<App />); | ||
expect(() => expect(Scheduler).toHaveYielded(['A', 'B'])).toThrow( | ||
'Expected value to equal:', | ||
'// deep equality', | ||
); | ||
}); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ module.exports = { | |
'.*': require.resolve('./preprocessor.js'), | ||
}, | ||
setupFiles: [require.resolve('./setupEnvironment.js')], | ||
setupTestFrameworkScriptFile: require.resolve('./setupTests.js'), | ||
setupFilesAfterEnv: [require.resolve('./setupTests.js')], | ||
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. renamed option |
||
// Only include files directly in __tests__, not in nested folders. | ||
testRegex: '/__tests__/[^/]*(\\.js|\\.coffee|[^d]\\.ts)$', | ||
moduleFileExtensions: ['js', 'json', 'node', 'coffee', 'ts'], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const pacote = require('pacote'); | ||
const rimraf = require('rimraf'); | ||
const prettyFormatPkg = require('pretty-format/package.json'); | ||
const prettyFormatPkgPath = require.resolve('pretty-format/package.json'); | ||
|
||
const reactIsDependencyVersion = prettyFormatPkg.dependencies['react-is']; | ||
|
||
if (!reactIsDependencyVersion) { | ||
throw new Error('Unable to find `react-is` dependency in `pretty-format`'); | ||
} | ||
|
||
const prettyFormatNodeModulesReactIsDir = path.join( | ||
path.dirname(prettyFormatPkgPath), | ||
'node_modules/react-is' | ||
); | ||
|
||
rimraf.sync(prettyFormatNodeModulesReactIsDir); | ||
|
||
pacote | ||
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. could possibly check in the tarball to avoid the network hit? Not sure if you want this at all, so I went with what's easiest/quickest/shortest |
||
.extract( | ||
`react-is@${reactIsDependencyVersion}`, | ||
prettyFormatNodeModulesReactIsDir | ||
) | ||
.catch(error => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
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.
this is quite possible also redundant now? not sure... but if it was here for jest@23, then it can go 🙂