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:
parent
15b0247363
commit
f8f96017e8
@ -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
|
// From: https://github.com/w3c/web-platform-tests/blob/master/encoding/api-invalid-label.html
|
||||||
[
|
[
|
||||||
'utf-8',
|
'utf-8',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user