Skip to content

Commit

Permalink
chore: apply legacy snapshot format to maintain same output for jest 29
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed May 31, 2023
1 parent f17f97d commit 2051601
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const baseConfig = {
cacheDirectory: '<rootDir>/node_modules/.cache/jest',
clearMocks: true,
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
// OLD format for migration to jest 29 - TODO: migrate to new format . https://jestjs.io/blog/2022/04/25/jest-28#future
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
};

module.exports = { ...baseConfig };
5 changes: 5 additions & 0 deletions scripts/jest/src/jest.preset.v0.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const createConfig = (/** @type {import('@jest/types').Config.InitialOptions} */
}),
...customConfig.moduleNameMapper,
},
// OLD format for migration to jest 29 - TODO: migrate to new format . https://jestjs.io/blog/2022/04/25/jest-28#future
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
});

module.exports = createConfig;
5 changes: 5 additions & 0 deletions scripts/jest/src/jest.preset.v8.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ const createConfig = (customConfig = {}) => {
clearMocks: true,

watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
// OLD format for migration to jest 29 - TODO: migrate to new format . https://jestjs.io/blog/2022/04/25/jest-28#future
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
};

return merge(defaultConfig, customConfig);
Expand Down

0 comments on commit 2051601

Please sign in to comment.