Skip to content

Commit

Permalink
Upgrade Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
kmjennison committed Oct 9, 2021
1 parent a8f5312 commit 06bb111
Show file tree
Hide file tree
Showing 4 changed files with 777 additions and 1,703 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/core": "^7.15.8",
"@babel/plugin-transform-runtime": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"babel-jest": "^26.1.0",
"babel-jest": "^27.2.5",
"babel-plugin-module-resolver": "^4.1.0",
"core-js": "^3.18.2",
"eslint": "^7.32.0",
Expand All @@ -46,12 +46,11 @@
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"if-env": "^1.0.4",
"jest": "^26.1.0",
"jest": "^27.2.5",
"mockdate": "^3.0.5",
"npm-run-all": "^4.1.5",
"prettier": "^2.4.1",
"prop-types": "^15.7.2",
"regenerator-runtime": "^0.13.7"
"prop-types": "^15.7.2"
},
"dependencies": {}
}
1 change: 0 additions & 1 deletion src/jestSetup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/* eslint-disable import/no-extraneous-dependencies */
import 'core-js/stable'
import 'regenerator-runtime/runtime'
6 changes: 3 additions & 3 deletions src/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* https://github.com/facebook/jest/issues/2157
* @return {Promise<undefined>}
*/
export const flushAllPromises = async () => {
await new Promise((resolve) => setImmediate(resolve))
}
export const flushAllPromises = async () =>
// https://github.com/facebook/jest/issues/2157#issuecomment-897935688
new Promise(jest.requireActual('timers').setImmediate)

/**
* Flush the Promise resolution queue, then all timers, and
Expand Down
Loading

0 comments on commit 06bb111

Please sign in to comment.