Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customserializer option to vitest.config.ts #2023

Closed
4 tasks done
ecstrema opened this issue Sep 10, 2022 · 0 comments · Fixed by #5092
Closed
4 tasks done

Add customserializer option to vitest.config.ts #2023

ecstrema opened this issue Sep 10, 2022 · 0 comments · Fixed by #5092
Labels
enhancement New feature or request p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome

Comments

@ecstrema
Copy link
Contributor

Clear and concise description of the problem

For compatibility with jest, add customSerializers as a global option.

Workaround:

Add a setup function, which runs expect.addSnapshotSerializer before every test file.

Suggested solution

Follow Jest's API

Alternative

Add a global setup file option, which is just run once during the entire jest process (not for every test file). This file could do something like expect.addSnapshotSerializer(mySerializer).

Con: No Jest compat
Pro: More flexible

Additional context

No response

Validations

@sheremet-va sheremet-va added the enhancement New feature or request label Sep 11, 2022
@sheremet-va sheremet-va added the p2-nice-to-have Not breaking anything but nice to have (priority) label Jan 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants