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]: Option to support Error#cause in snapshots for Jest29 #14916

Closed
fisker opened this issue Feb 22, 2024 · 4 comments
Closed

[Feature]: Option to support Error#cause in snapshots for Jest29 #14916

fisker opened this issue Feb 22, 2024 · 4 comments

Comments

@fisker
Copy link
Contributor

fisker commented Feb 22, 2024

🚀 Feature Proposal

Since we will drop support for Node.js v14. It's easier to just simply use Jest29 in node14.
But the snapshots won't match since Jest30 snapshots Error#cause, and it's hard to solve, suggest to backport #13965 but behind an option.

Motivation

Driving me crazy... prettier/prettier#16106

Example

No response

Pitch

N/A

@SimenB
Copy link
Member

SimenB commented Feb 22, 2024

We don't really do backporting. But even if we make it optional in Jest 30, I'm not 100% sure how it'd be configured 🤔 Might make more sense for you to create your own snapshotmatcher that ignores the cause if you don't want it (or adds the cause for Jest 29)

@fisker fisker closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2024
@SimenB
Copy link
Member

SimenB commented Feb 24, 2024

You were able to work around it?

@fisker
Copy link
Contributor Author

fisker commented Feb 26, 2024

Since Jest 30.0.0-alpha.2 works on Node.js v14 and snapshots .cause, using it for now https://github.com/prettier/prettier/pull/16106/files

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants