豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 78611f1

Browse files
feat: add 'jest-snapshot-serializer-raw/always' as default snapshotSerializer (#206)
BREAKING CHANGE: snapshots will now be serialized by 'jest-snapshot-serializer-raw/always'
1 parent 17ddc27 commit 78611f1

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

jest.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,4 @@ const {jest} = require('./src/config')
33
module.exports = {
44
...jest,
55
coverageThreshold: null,
6-
snapshotSerializers: [
7-
...jest.snapshotSerializers,
8-
'jest-snapshot-serializer-raw/always',
9-
],
106
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"is-ci": "^3.0.0",
7171
"jest": "^26.6.3",
7272
"jest-serializer-path": "^0.1.15",
73+
"jest-snapshot-serializer-raw": "^1.2.0",
7374
"jest-watch-typeahead": "^0.6.2",
7475
"lint-staged": "^10.5.4",
7576
"lodash.camelcase": "^4.3.0",
@@ -117,7 +118,6 @@
117118
"homepage": "https://github.com/kentcdodds/kcd-scripts#readme",
118119
"devDependencies": {
119120
"jest-in-case": "^1.0.2",
120-
"jest-snapshot-serializer-raw": "^1.2.0",
121121
"slash": "^3.0.0"
122122
}
123123
}

src/config/jest.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ const jestConfig = {
4646
require.resolve('jest-watch-typeahead/filename'),
4747
require.resolve('jest-watch-typeahead/testname'),
4848
],
49-
snapshotSerializers: [require.resolve('jest-serializer-path')],
49+
snapshotSerializers: [
50+
require.resolve('jest-serializer-path'),
51+
require.resolve('jest-snapshot-serializer-raw/always'),
52+
],
5053
}
5154

5255
const setupFiles = [

0 commit comments

Comments
 (0)