From 78611f13c3672b711a6fae8815d77bfc0f84c8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Mon, 26 Apr 2021 19:41:43 +0200 Subject: [PATCH] feat: add 'jest-snapshot-serializer-raw/always' as default snapshotSerializer (#206) BREAKING CHANGE: snapshots will now be serialized by 'jest-snapshot-serializer-raw/always' --- jest.config.js | 4 ---- package.json | 2 +- src/config/jest.config.js | 5 ++++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/jest.config.js b/jest.config.js index 4e778dff..17bc85ab 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,8 +3,4 @@ const {jest} = require('./src/config') module.exports = { ...jest, coverageThreshold: null, - snapshotSerializers: [ - ...jest.snapshotSerializers, - 'jest-snapshot-serializer-raw/always', - ], } diff --git a/package.json b/package.json index 044f50dc..6541af47 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "is-ci": "^3.0.0", "jest": "^26.6.3", "jest-serializer-path": "^0.1.15", + "jest-snapshot-serializer-raw": "^1.2.0", "jest-watch-typeahead": "^0.6.2", "lint-staged": "^10.5.4", "lodash.camelcase": "^4.3.0", @@ -117,7 +118,6 @@ "homepage": "https://github.com/kentcdodds/kcd-scripts#readme", "devDependencies": { "jest-in-case": "^1.0.2", - "jest-snapshot-serializer-raw": "^1.2.0", "slash": "^3.0.0" } } diff --git a/src/config/jest.config.js b/src/config/jest.config.js index a628aa80..8548f4fa 100644 --- a/src/config/jest.config.js +++ b/src/config/jest.config.js @@ -46,7 +46,10 @@ const jestConfig = { require.resolve('jest-watch-typeahead/filename'), require.resolve('jest-watch-typeahead/testname'), ], - snapshotSerializers: [require.resolve('jest-serializer-path')], + snapshotSerializers: [ + require.resolve('jest-serializer-path'), + require.resolve('jest-snapshot-serializer-raw/always'), + ], } const setupFiles = [