Skip to content

Commit

Permalink
More specific error message tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyGu committed Jan 20, 2017
1 parent 44acced commit 182ce97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-whatwg-url-searchparams.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ sp.forEach(function(val, key, obj) {
sp.forEach(function() {
assert.strictEqual(this, m);
}, m);
assert.throws(() => sp.forEach(), TypeError);
assert.throws(() => sp.forEach(1), TypeError);
assert.throws(() => sp.forEach(),
/^TypeError: The `callback` argument needs to be specified$/);
assert.throws(() => sp.forEach(1),
/^TypeError: The `callback` argument must be a function$/);

m.search = '?a=a&b=b';
assert.strictEqual(sp.toString(), 'a=a&b=b');

0 comments on commit 182ce97

Please sign in to comment.