jest-serializer-vue-tjw is a Jest snapshot serializer specifically designed to make Vue component snapshots more readable and maintainable by normalizing HTML output. It handles common issues like attribute ordering, inline functions, and various `data-` attributes that can cause unnecessary snapshot churn. The package is currently at version 4.0.0, but this version primarily serves as a deprecation notice. The library is no longer actively maintained and has been replaced by `vue3-snapshot-serializer`. While `jest-serializer-vue-tjw` supported both Vue 2 and Vue 3 (with some caveats for the latter), its replacement is Vue 3-only and introduces several new features and improved configuration options. Users are advised to migrate to `vue3-snapshot-serializer` for new projects or Vue 3 codebases, or to pin this library to `3.x.x` if they must remain on Vue 2.
npm install jest-serializer-vue-tjwVerified import paths — ran on the pinned version, not inferred.
Demonstrates the `jest.config.js` setup for integrating the serializer and example configuration settings within `package.json` for customized snapshot behavior.
For new projects or existing Vue 3 projects, migrate to `vue3-snapshot-serializer`. For Vue 2 projects that cannot migrate to Vue 3, pin `jest-serializer-vue-tjw` to `3.x.x` to avoid deprecation warnings.
Review and update affected snapshots after upgrading to v3.20.0 or later.
Update snapshots if attribute order changes. To opt-out, set `sortAttributes` to `false` in your configuration.
If you relied on Istanbul comments being present in snapshots (unlikely), you can disable `removeIstanbulComments`. Otherwise, review and update snapshots.
Review and update snapshots to reflect any minor formatting changes.
Upgrade to v3.14.0 or later, or manually update affected snapshots.
Ensure your `jest.config.js`'s `snapshotSerializers` array contains the string path to the serializer, e.g., `"<rootDir>/node_modules/jest-serializer-vue-tjw"`.
This is often an intentional improvement. Accept the new snapshots or set `sortAttributes: false` in your configuration if you need to preserve original attribute order.
Upgrade to v3.16.0 or later, which enables `removeIstanbulComments` by default, or explicitly set `removeIstanbulComments: true` in your serializer configuration.
Migrate your project to use `vue3-snapshot-serializer` for full Vue 3 compatibility and access to new features. Follow the migration guide in the `jest-serializer-vue-tjw` README.
No dependency data recorded yet.