Skip to content

Commit 9ec105c

Browse files
BeniChenitargos
authored andcommitted
test: improve code coverage for string decoder
PR-URL: #22306 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 1e7deb7 commit 9ec105c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/parallel/test-string-decoder.js

+10
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ common.expectsError(
161161
}
162162
);
163163

164+
common.expectsError(
165+
() => new StringDecoder('utf8').write(null),
166+
{
167+
code: 'ERR_INVALID_ARG_TYPE',
168+
type: TypeError,
169+
message: 'The "buf" argument must be one of type Buffer, Uint8Array, or' +
170+
' ArrayBufferView. Received type object'
171+
}
172+
);
173+
164174
// test verifies that StringDecoder will correctly decode the given input
165175
// buffer with the given encoding to the expected output. It will attempt all
166176
// possible ways to write() the input buffer, see writeSequences(). The

0 commit comments

Comments
 (0)