test: check complete error message

In test-stream-writable-change-default-encoding, use a regular
expression to match the complete error message.

PR-URL: https://github.com/nodejs/node/pull/14264
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
This commit is contained in:
Fraser Xu 2017-07-16 15:06:32 +08:00 committed by Rich Trott
parent fb37922cf3
commit 35398af68e

View File

@ -61,7 +61,7 @@ assert.throws(function changeDefaultEncodingToInvalidValue() {
m.setDefaultEncoding({});
m.write('bar');
m.end();
}, TypeError);
}, /^TypeError: Unknown encoding: \[object Object\]$/);
(function checkVairableCaseEncoding() {
const m = new MyWritable(function(isBuffer, type, enc) {