summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortimothy searcy <timmyzsearcy@gmail.com>2018-11-29 19:01:09 -0800
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-12-03 08:24:46 +0100
commitf8f96017e82abe4e965251b2f6072bdb6bea9d51 (patch)
tree55e671ba8e8ec44e12de9c29c12d30939a1090c5
parent15b024736307c8d12651cf7ac18435b5e40a0cae (diff)
downloadandroid-node-v8-f8f96017e82abe4e965251b2f6072bdb6bea9d51.tar.gz
android-node-v8-f8f96017e82abe4e965251b2f6072bdb6bea9d51.tar.bz2
android-node-v8-f8f96017e82abe4e965251b2f6072bdb6bea9d51.zip
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>
-rw-r--r--test/parallel/test-whatwg-encoding-textdecoder.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-whatwg-encoding-textdecoder.js b/test/parallel/test-whatwg-encoding-textdecoder.js
index 0a812504f6..e1d8575a64 100644
--- a/test/parallel/test-whatwg-encoding-textdecoder.js
+++ b/test/parallel/test-whatwg-encoding-textdecoder.js
@@ -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',