-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Snapshot testing #48260
Comments
I would definitely sign off on a new implementation of |
I am +1. |
It would be great to clarify expectations and requirements before we implement any API. For example, would users expect snapshot testing to support data types other than strings? |
I would just see how other test runners, like Vitest and Jest, implement snapshots and do the same. |
Would really like to see this added to node +1 |
I think this does not belong in node core because it's too specific. But I think we should facilitate it. In order to do so, I believe we need to expose some additional properties on
Then someone (such as me—I just started a basic package for it to include/reference from the nodejs.org Learn article I'm working on) has sufficient data available to do this. |
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. Fixes: nodejs#48260
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. Fixes: nodejs#48260
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. Fixes: nodejs#48260
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. Fixes: nodejs#48260
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. PR-URL: #53169 Fixes: #48260 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. PR-URL: nodejs#53169 Fixes: nodejs#48260 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
This commit adds a t.assert.snapshot() method that implements snapshot testing. Serialization uses JSON.stringify() by default, but users can configure the serialization to meet their needs. PR-URL: nodejs#53169 Fixes: nodejs#48260 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
What is the problem this feature will solve?
It would be useful to have snapshot testing as part of the built-in test runner or assertion library.
I am aware of earlier work on this, specifically the inclusion and then removal of
assert.snapshot
as per #44466 and #46112.I'm wondering if there's a consensus that snapshot testing should not live in Node core or if you would be open to an implementation without the shortcomings of the earlier one.
What is the feature you are proposing to solve the problem?
I would propose an implementation in Node core, which would play well with the built-in test runner
What alternatives have you considered?
The only real alternative at the moment would be using a different testing framework. I haven't considered whether snapshot testing could be implemented as a standalone library though.
The text was updated successfully, but these errors were encountered: