Skip to content
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

Bump babel-jest from 24.9.0 to 27.2.1 #685

Merged
merged 4 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"axe-core": "^4.3.3",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^8.0.2",
"babel-jest": "^24.7.1",
"babel-jest": "^27.2.1",
"babel-loader": "^8.0.0",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-istanbul": "^5.1.1",
Expand All @@ -74,7 +74,7 @@
"fs-extra": "^7.0.1",
"glob": "^7.1.2",
"is-docker": "^1.1.0",
"jest": "^24.7.1",
"jest": "^27.2.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the next issue with cwd not being found. jest and babel-jest need to be on the same version.

jestjs/jest#7868 (comment)

"karma": "1.6",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^2.0.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/formation/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
transform: {
"^.+\\.js$": "<rootDir>/packages/formation/scripts/babel-transformer.js",
'^.+\\.js$': '<rootDir>/packages/formation/scripts/babel-transformer.js',
},
testEnvironment: 'jsdom',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue with window not being defined. The default environment is node, where things like window don't exist.

https://jestjs.io/docs/configuration#testenvironment-string

rootDir: '../..',
testMatch: [`<rootDir>/packages/formation/__tests__/**/*.test.js`],
};
2 changes: 1 addition & 1 deletion packages/formation/scripts/babel-transformer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = require('babel-jest').createTransformer({
module.exports = require('babel-jest').default.createTransformer({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the original issue with createTransformer not being found.

jestjs/jest#11444 (comment)

rootMode: 'upward',
});
Loading