Skip to content

Commit

Permalink
Merge 90fd112 into c00a4f5
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed Jun 17, 2019
2 parents c00a4f5 + 90fd112 commit af7eb56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -72,7 +72,7 @@
"unexpected": "^11.6.1",
"unexpected-documentation-site-generator": "^6.0.0",
"unexpected-markdown": "^3.0.0",
"unexpected-snapshot": "^0.5.0"
"unexpected-snapshot": "^0.6.0"
},
"dependencies": {
"extend": "^3.0.1",
Expand Down
18 changes: 10 additions & 8 deletions test/index.spec.js
Expand Up @@ -11,21 +11,23 @@ it.skipIf = function(bool, descr, block) {
expect.addAssertion(
'<function> to error satisfying <assertion>',
(expect, cb) =>
expect(cb, 'to error').then(err =>
expect.shift(
expect(cb, 'to error').then(err => {
expect.errorMode = 'nested';
return expect.shift(
err.isUnexpected ? err.getErrorMessage('text').toString() : err.message
)
)
);
})
);

expect.addAssertion(
'<function> to throw an error satisfying <assertion>',
(expect, cb) =>
expect(cb, 'to throw').then(err =>
expect.shift(
expect(cb, 'to throw').then(err => {
expect.errorMode = 'nested';
return expect.shift(
err.isUnexpected ? err.getErrorMessage('text').toString() : err.message
)
)
);
})
);

expect.addAssertion(
Expand Down

0 comments on commit af7eb56

Please sign in to comment.