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

[Feature]: How to reuse createSnapshotSerializer in test helper #3099

Closed
fi3ework opened this issue Aug 1, 2024 · 5 comments · Fixed by #3165
Closed

[Feature]: How to reuse createSnapshotSerializer in test helper #3099

fi3ework opened this issue Aug 1, 2024 · 5 comments · Fixed by #3165
Assignees

Comments

@fi3ework
Copy link
Member

fi3ework commented Aug 1, 2024

What problem does this feature solve?

The createSnapshotSerializer (https://github.com/web-infra-dev/rsbuild/blob/main/scripts/test-helper/src/index.ts#L17C17-L50) is battle tested and not coupled with Rsbuild. If possible, I could help to extract it to a new package and put it under rspack-contrib organization, and reuse it in Rslib 🤗.

What does the proposed API look like?

N/A.

@SoonIter
Copy link
Member

SoonIter commented Aug 1, 2024

I'm curious if this serializer can be used by both vitest and jest.
web-infra-dev/rspack#7156

Rspack also needs this

@fi3ework
Copy link
Member Author

fi3ework commented Aug 1, 2024

I used to use a Jest serializer plugin in Vitest in other project. "Jest as a spec, Vitest as a implementaion", I believe so.

@chenjiahan
Copy link
Member

LGTM 👍

@fi3ework
Copy link
Member Author

fi3ework commented Aug 1, 2024

Any suggestion for the package name? rsserializer? 🤣

@chenjiahan
Copy link
Member

Maybe it doesn't need the rs keyword, just use anything you want 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants