From 3cf063d502b9fe5dd5216c23cffda8b2d5cb92a6 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 adds a test for the validateArguments function in TextDecoder --- 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',