Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

feat: show snapshot name in error message #162

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ describe('focused input field', () => {
cy.visit('http://todomvc.com/examples/react/')
cy
.focused()
.snapshot('initial')
.snapshot({ name: 'initial' })
.type('eat healthy breakfast')
.snapshot('after typing')
.snapshot({ name: 'after typing' })
})
})
```
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function registerCypressSnapshot () {
devToolsLog.expected = expected
delete devToolsLog.value
devToolsLog.value = value
throw new Error(`Snapshot difference. To update, delete snapshot and rerun test.\n${json.message}`)
throw new Error(`Snapshot "${name}" difference. To update, delete snapshot and rerun test.\n${json.message}`)
})
}

Expand Down