Skip to content

Commit

Permalink
test: update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed May 28, 2019
1 parent b82702b commit 20f3bfc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const pretty = createPretty(DEFAULT_PRETTY)
const getPretty = opts => (isNil(opts) ? pretty : createPretty(opts))

const cleanError = error => {
error.stack = !isNil(error.stack) ? cleanStack(error.stack) : null
if (error.stack) error.stack = cleanStack(error.stack)
return error
}

Expand Down
3 changes: 1 addition & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ const test = require('ava')
const beautyError = require('..')

test('pretty an error', t => {
const error = new Error("Hello darkness my old' friend")
t.snapshot(beautyError({ ...error, stack: '' }))
t.snapshot(beautyError(new Error("Hello darkness my old' friend")))
})
20 changes: 19 additions & 1 deletion test/snapshots/index.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,23 @@ Generated by [AVA](https://ava.li).

> Snapshot 1
` Error ␊
` Error Hello darkness my old' friend␊
 ␊
 - index.js:7 ␊
  /Users/josefranciscoverdugambin/Projects/beauty-error/test/index.js:7:26␊
 ␊
 - test.js:316 Test.callFn␊
  [beauty-error]/[ava]/lib/test.js:316:21␊
 ␊
 - test.js:329 Test.run␊
  [beauty-error]/[ava]/lib/test.js:329:23␊
 ␊
 - runner.js:259 Runner.runSingle␊
  [beauty-error]/[ava]/lib/runner.js:259:19␊
 ␊
 - runner.js:322 ␊
  [beauty-error]/[ava]/lib/runner.js:322:16␊
 ␊
 - async Promise.all␊
 ␊
`
Binary file modified test/snapshots/index.js.snap
Binary file not shown.

0 comments on commit 20f3bfc

Please sign in to comment.