diff --git a/.changeset/nine-keys-accept.md b/.changeset/nine-keys-accept.md new file mode 100644 index 000000000..8f339a81c --- /dev/null +++ b/.changeset/nine-keys-accept.md @@ -0,0 +1,22 @@ +--- +'skuba': patch +--- + +test: Disable Prettier snapshot formatting + +Jest is not yet compatible with Prettier 3, causing snapshot updates to fail with the following error: + +```typescript +TypeError: prettier.resolveConfig.sync is not a function + at runPrettier (node_modules/jest-snapshot/build/InlineSnapshots.js:308:30) +``` + +We have disabled Prettier snapshot formatting in our Jest preset as a temporary workaround. If you do not use the preset, you can manually modify your `jest.config.ts` like so: + +```diff +export default { ++ prettierPath: null, +} +``` + +You may have to run `skuba format` manually after updating snapshots until [jestjs/jest#14305](https://github.com/jestjs/jest/issues/14305) is resolved. diff --git a/jest-preset.js b/jest-preset.js index 27baa3b87..d93dddbea 100644 --- a/jest-preset.js +++ b/jest-preset.js @@ -27,6 +27,8 @@ module.exports = { '/node_modules.*/', '/(coverage|dist|lib|tmp).*/', ], + // jestjs/jest#14305 + prettierPath: null, watchPlugins: [ require.resolve('jest-watch-typeahead/filename'), require.resolve('jest-watch-typeahead/testname'),