Skip to content

Commit 9331e9d

Browse files
committed
maint(Build): Compatibility with Jest 28.
Remove jest-raw-loader dependency and add own loader based on keplersj/jest-raw-loader#239 for compatibility with Jest 28.
1 parent bc69bc4 commit 9331e9d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
55
transform: {
66
"^.+\\.[t|j]sx?$": "babel-jest",
7-
"\\.(html|xml|svg)$": "jest-raw-loader",
7+
"\\.(html|xml|svg)$": "<rootDir>/webpack/jest-raw-loader.js",
88
},
99
moduleNameMapper: {
1010
"\\.(css|less|sass|scss)$": "identity-obj-proxy",

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"inspectpack": "^4.7.1",
6060
"jest": "^28.0.2",
6161
"jest-environment-jsdom": "^28.0.2",
62-
"jest-raw-loader": "^1.0.1",
6362
"jest-watch-typeahead": "^1.1.0",
6463
"prettier": "^2.6.2",
6564
"regenerator-runtime": "^0.13.9",

webpack/jest-raw-loader.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// jest-raw-loader compatibility with Jest version 28.
2+
// See: https://github.com/keplersj/jest-raw-loader/pull/239
3+
module.exports = {
4+
process: (content) => {
5+
return {
6+
code: "module.exports = " + JSON.stringify(content),
7+
};
8+
},
9+
};

0 commit comments

Comments
 (0)