Skip to content

Commit 35398af

Browse files
fraserxuTrott
authored andcommitted
test: check complete error message
In test-stream-writable-change-default-encoding, use a regular expression to match the complete error message. PR-URL: #14264 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Bryan English <[email protected]>
1 parent fb37922 commit 35398af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-stream-writable-change-default-encoding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ assert.throws(function changeDefaultEncodingToInvalidValue() {
6161
m.setDefaultEncoding({});
6262
m.write('bar');
6363
m.end();
64-
}, TypeError);
64+
}, /^TypeError: Unknown encoding: \[object Object\]$/);
6565

6666
(function checkVairableCaseEncoding() {
6767
const m = new MyWritable(function(isBuffer, type, enc) {

0 commit comments

Comments
 (0)