Skip to content

Commit

Permalink
test: improve code coverage for string decoder
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
BeniCheni authored and targos committed Sep 3, 2018
1 parent 1e7deb7 commit 9ec105c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-string-decoder.js
Expand Up @@ -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
// buffer with the given encoding to the expected output. It will attempt all
// possible ways to write() the input buffer, see writeSequences(). The
Expand Down

0 comments on commit 9ec105c

Please sign in to comment.