Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More specific error message tests
  • Loading branch information
TimothyGu committed Jan 20, 2017
commit 182ce97f3bfaf351d2c64a5f65415b2b68443b75
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');