cypress-io / snapshot

Adds value / object / DOM element snapshot testing support to Cypress test runner
116 stars 25 forks source link

Using #149

Open hannaofsweden opened 3 years ago

hannaofsweden commented 3 years ago

Thank you for taking time to open a new issue. Please answer a few questions to help us fix it faster. You can delete text that is irrelevant to the issue.

Is this a bug report or a feature request?

Bug report.

If this is a bug report, please provide as much info as possible

2.1.7

Windows, Unix

Calling snapshot like this:

snapshot('Before typing')

Should result in a line in snapshot.json like this:

"Before typing": "<div>Example HTML code</div"

The resulting file always uses the index of the snapshot in the test, i.e.:

1: "<div>Example HTML code</div"

This is in confilct with the documentation. You can use this format to do it but it's more verbose:

snapshot( { name: "Before typing" } )