Skip to content

Commit

Permalink
test: check invalid argument error for option
Browse files Browse the repository at this point in the history
This commit adds a test for the validateArguments function in
TextDecoder.

PR-URL: #24736
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
nanomosfet authored and danbev committed Dec 3, 2018
1 parent 15b0247 commit f8f9601
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-whatwg-encoding-textdecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ testDecodeSample(
]
);

{
common.expectsError(
() => new TextDecoder('utf-8', 1),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError
}
);
}

// From: https://github.com/w3c/web-platform-tests/blob/master/encoding/api-invalid-label.html
[
'utf-8',
Expand Down

0 comments on commit f8f9601

Please sign in to comment.