Skip to content

Commit

Permalink
Add tests for Bang.wrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
sholladay committed Feb 16, 2020
1 parent fc0362b commit 26eeb57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/bang.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,14 @@ test('new Bang() with error and 501 status', () => {
status : 501
});
});

test('Bang.wrap() returns Bang instance as-is', () => {
const error = new bang.Bang();
assertStrictEq(bang.Bang.wrap(error), error);
});

test('Bang.wrap() constructs new Bang from string', () => {
const error = bang.Bang.wrap('hello');
assertEquals(error, new bang.Bang('hello'));
assertStrictEq(error.constructor, bang.Bang);
});

0 comments on commit 26eeb57

Please sign in to comment.