Skip to content

Commit

Permalink
maint(Build): Compatibility with Jest 28.
Browse files Browse the repository at this point in the history
Remove jest-raw-loader dependency and add own loader based on keplersj/jest-raw-loader#239 for compatibility with Jest 28.
  • Loading branch information
thet committed May 16, 2022
1 parent 5679db0 commit 69b7934
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
transform: {
"^.+\\.[t|j]sx?$": "babel-jest",
"\\.(html|xml|svg)$": "jest-raw-loader",
"\\.(html|xml|svg)$": "<rootDir>/webpack/jest-raw-loader.js",
},
moduleNameMapper: {
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"inspectpack": "^4.7.1",
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"jest-raw-loader": "^1.0.1",
"jest-watch-typeahead": "^1.1.0",
"prettier": "^2.6.2",
"regenerator-runtime": "^0.13.9",
Expand Down
9 changes: 9 additions & 0 deletions webpack/jest-raw-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// jest-raw-loader compatibility with Jest version 28.
// See: https://github.com/keplersj/jest-raw-loader/pull/239
module.exports = {
process: (content) => {
return {
code: "module.exports = " + JSON.stringify(content),
};
},
};

0 comments on commit 69b7934

Please sign in to comment.