Skip to content

Commit b9b343c

Browse files
bangwuMylesBorins
authored andcommitted
test: use regexp to confir error message
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>
1 parent 94ff591 commit b9b343c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-stream-writable-null.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ assert.doesNotThrow(() => {
3232
assert.throws(() => {
3333
const m = new MyWritable();
3434
m.write(false, (err) => assert.ok(err));
35-
}, TypeError, 'Invalid non-string/buffer chunk');
35+
}, /^TypeError: Invalid non-string\/buffer chunk$/);
3636
assert.doesNotThrow(() => {
3737
const m = new MyWritable().on('error', (e) => {
3838
assert.ok(e);

0 commit comments

Comments
 (0)