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 <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
bangwu authored and MylesBorins committed Aug 16, 2017
1 parent 8c41325 commit 8a3c113
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 8a3c113

Please sign in to comment.