Browse Source

test: use regular expression to match error msg

PR-URL: https://github.com/nodejs/node/pull/14265
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
Flandre 8 years ago
committed by Rich Trott
parent
commit
bfae1feb38
  1. 2
      test/parallel/test-stream-writable-null.js

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

@ -19,7 +19,7 @@ MyWritable.prototype._write = function(chunk, encoding, callback) {
assert.throws(() => {
const m = new MyWritable({objectMode: true});
m.write(null, (err) => assert.ok(err));
}, TypeError, 'May not write null values to stream');
}, /^TypeError: May not write null values to stream$/);
assert.doesNotThrow(() => {
const m = new MyWritable({objectMode: true}).on('error', (e) => {
assert.ok(e);

Loading…
Cancel
Save