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 <[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]>
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)