Skip to content

Commit

Permalink
fix: jest configuration changes to allow is-plain-obj esm
Browse files Browse the repository at this point in the history
  • Loading branch information
rjchow committed Aug 17, 2022
1 parent d6224d8 commit e2d4a97
Show file tree
Hide file tree
Showing 22 changed files with 2,474 additions and 2,852 deletions.
4 changes: 4 additions & 0 deletions packages/js/components/changelog/fix-add-babel-jest
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
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
@@ -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
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
@@ -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
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

0 comments on commit e2d4a97

Please sign in to comment.