From 7577e754bb83c295897a1f115cad956018e26d97 Mon Sep 17 00:00:00 2001 From: timothy searcy Date: Thu, 29 Nov 2018 19:01:09 -0800 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig --- test/parallel/test-whatwg-encoding-textdecoder.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/parallel/test-whatwg-encoding-textdecoder.js b/test/parallel/test-whatwg-encoding-textdecoder.js index 0a812504f6179e..e1d8575a644490 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',