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

Commit

Permalink
assert_error: default to deep equal assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Oct 4, 2019
1 parent 2dd8938 commit 06afdb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/api.assert_error.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = assert_error = (err, assert = {}, exhaustive = false) ->
else if expect is null
should(value).be.null()
else
should.fail()
should(value).deepEqual expect

describe 'API assert_error', ->

Expand All @@ -35,12 +35,13 @@ describe 'API assert_error', ->
message: 'A message'
]

it 'detect a property not in assert', ->
it 'exhaustive detect a property not in assert', ->
err = new CsvError 'A_MESSAGE', 'A message', a_key: 'a value'
( ->
assert_error err,
code: 'A_MESSAGE'
message: 'A message'
, true
).should.throw /expected Object .* to have key a_key/

it 'detect a property not in error', ->
Expand Down

0 comments on commit 06afdb1

Please sign in to comment.