test: improve code coverage for string decoder
PR-URL: https://github.com/nodejs/node/pull/22306 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
902fd40ed5
commit
5673017c33
@ -161,6 +161,16 @@ common.expectsError(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
common.expectsError(
|
||||||
|
() => new StringDecoder('utf8').write(null),
|
||||||
|
{
|
||||||
|
code: 'ERR_INVALID_ARG_TYPE',
|
||||||
|
type: TypeError,
|
||||||
|
message: 'The "buf" argument must be one of type Buffer, Uint8Array, or' +
|
||||||
|
' ArrayBufferView. Received type object'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// test verifies that StringDecoder will correctly decode the given input
|
// test verifies that StringDecoder will correctly decode the given input
|
||||||
// buffer with the given encoding to the expected output. It will attempt all
|
// buffer with the given encoding to the expected output. It will attempt all
|
||||||
// possible ways to write() the input buffer, see writeSequences(). The
|
// possible ways to write() the input buffer, see writeSequences(). The
|
||||||
|
Loading…
x
Reference in New Issue
Block a user