Skip to content

Commit

Permalink
Improve no snapshot found message
Browse files Browse the repository at this point in the history
  • Loading branch information
torztomasz committed Nov 5, 2024
1 parent 6098a2c commit f68b2ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ describe(toMatchSnapshot.name, () => {
it('fails when a value is not present in the snapshot', () => {
expect(() => {
earl('baz').toMatchSnapshot(mochaContext('unknown'))
}).to.throw('No snapshot was found. Snapshots cannot be generated on CI.')
}).to.throw(
'No snapshot was found. Snapshots cannot be generated on CI. Run tests locally to generate snapshots.',
)
})

it('cannot be set to update on ci', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/earl/src/validators/snapshots/toMatchSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function toMatchSnapshot(control: Control, context: TestContext) {
} else if (snapshot.expected === undefined) {
control.assert({
success: false,
reason: 'No snapshot was found. Snapshots cannot be generated on CI.',
reason: 'No snapshot was found. Snapshots cannot be generated on CI. Run tests locally to generate snapshots.',
negatedReason: '',
actual,
expected: undefined,
Expand Down

0 comments on commit f68b2ba

Please sign in to comment.