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

fix: jest configuration changes to allow is-plain-obj esm #34334

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/js/components/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2",
"webpack": "^5.70.0",
"webpack-cli": "^3.3.12"
Expand Down
4 changes: 4 additions & 0 deletions packages/js/csv-export/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/csv-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"jest-cli": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"lint-staged": {
Expand Down
4 changes: 4 additions & 0 deletions packages/js/currency/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/currency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"jest-cli": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/customer-effort-score/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2",
"webpack": "^5.70.0",
"webpack-cli": "^3.3.12"
Expand Down
4 changes: 4 additions & 0 deletions packages/js/data/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"redux": "^4.1.0",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"peerDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/js/date/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"jest-cli": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"peerDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/js/experimental/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2",
"webpack": "^5.70.0",
"webpack-cli": "^3.3.12"
Expand Down
4 changes: 4 additions & 0 deletions packages/js/explat/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/explat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"jest-cli": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"scripts": {
Expand Down
12 changes: 7 additions & 5 deletions packages/js/internal-js-tests/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ module.exports = {
__dirname,
'../../../plugins/woocommerce-admin/client/$1'
),
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(
__dirname,
'build/mocks/static'
),
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
path.resolve( __dirname, 'build/mocks/static' ),
'\\.(scss|css)$': path.resolve(
__dirname,
'build/mocks/style-mock.js'
Expand All @@ -42,8 +40,12 @@ module.exports = {
'<rootDir>/.*/build-module/',
'<rootDir>/tests/e2e/',
],
transformIgnorePatterns: [ '/node_modules', '/build/' ],
transformIgnorePatterns: [
`node_modules/(?!.pnpm/is-plain-obj|is-plain-obj)`, // do not apply transforms to anything in node_modules except for the esm packages we need to transpile
'/build/',
],
transform: {
'^.+\\is-plain-obj/index\\.js$': 'babel-jest',
'^.+\\.[jt]sx?$': 'ts-jest',
},
testEnvironment: 'jest-environment-jsdom',
Expand Down
4 changes: 4 additions & 0 deletions packages/js/navigation/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"jest-cli": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"lint-staged": {
Expand Down
4 changes: 4 additions & 0 deletions packages/js/number/changelog/fix-add-babel-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Added babel-jest to allow jest to process esm dependencies during test runs
1 change: 1 addition & 0 deletions packages/js/number/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"jest-cli": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"babel-jest": "^28.1.3",
"typescript": "^4.6.2"
},
"lint-staged": {
Expand Down