Skip to content

Commit b14b14d

Browse files
committed
chore: add patch to handle jest-snapshot bug #10217
1 parent 9df2128 commit b14b14d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"types"
3737
],
3838
"scripts": {
39-
"pretest": "yarn link && yarn link \"@pmmmwh/react-refresh-webpack-plugin\"",
39+
"pretest": "patch-package && yarn link && yarn link \"@pmmmwh/react-refresh-webpack-plugin\"",
4040
"posttest": "yarn unlink \"@pmmmwh/react-refresh-webpack-plugin\"",
4141
"test": "node scripts/test.js",
4242
"lint": "eslint --report-unused-disable-directives --ext .js .",
@@ -76,6 +76,7 @@
7676
"jest-watch-typeahead": "^0.6.0",
7777
"memfs": "^3.2.0",
7878
"nanoid": "^3.1.10",
79+
"patch-package": "^6.2.2",
7980
"prettier": "^2.0.5",
8081
"puppeteer": "^3.3.0",
8182
"react-refresh": "^0.8.3",

patches/jest-snapshot+26.1.0.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/node_modules/jest-snapshot/build/index.js b/node_modules/jest-snapshot/build/index.js
2+
index 9094081..db825d4 100644
3+
--- a/node_modules/jest-snapshot/build/index.js
4+
+++ b/node_modules/jest-snapshot/build/index.js
5+
@@ -504,7 +504,10 @@ const toThrowErrorMatchingInlineSnapshot = function (
6+
return _toThrowErrorMatchingSnapshot(
7+
{
8+
context: this,
9+
- inlineSnapshot,
10+
+ inlineSnapshot:
11+
+ inlineSnapshot !== undefined
12+
+ ? stripAddedIndentation(inlineSnapshot)
13+
+ : undefined,
14+
isInline: true,
15+
matcherName,
16+
received

0 commit comments

Comments
 (0)