Skip to content

Commit

Permalink
test: use regexp to confir error message
Browse files Browse the repository at this point in the history
In test/parallel/test-stream-writable-null.js, use a regular expression
to validate error message in assert.throws() call.

PR-URL: #14268
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
bangwu authored and addaleax committed Jul 18, 2017
1 parent e37510a commit 76a4671
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-stream-writable-null.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ assert.doesNotThrow(() => {
assert.throws(() => {
const m = new MyWritable();
m.write(false, (err) => assert.ok(err));
}, TypeError, 'Invalid non-string/buffer chunk');
}, /^TypeError: Invalid non-string\/buffer chunk$/);
assert.doesNotThrow(() => {
const m = new MyWritable().on('error', (e) => {
assert.ok(e);
Expand Down

0 comments on commit 76a4671

Please sign in to comment.