test: check invalid argument error for option

This commit adds a test for the validateArguments function in
TextDecoder.

PR-URL: https://github.com/nodejs/node/pull/24736
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
timothy searcy 2018-11-29 19:01:09 -08:00 committed by Daniel Bevenius
parent 15b0247363
commit f8f96017e8

View File

@ -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',