Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bbf9da8

Browse filesBrowse files
juanarbolRafaelGSS
authored andcommitted
test: improve test coverage for WHATWG TextDecoder
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com> PR-URL: #45241 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 58b836f commit bbf9da8
Copy full SHA for bbf9da8

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-whatwg-encoding-custom-textdecoder.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-encoding-custom-textdecoder.js
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ assert(TextDecoder);
5151
});
5252
}
5353

54+
// Invalid encoders
55+
{
56+
['meow', 'nonunicode', 'foo', 'bar'].forEach((fakeEncoding) => {
57+
assert.throws(
58+
() => { new TextDecoder(fakeEncoding); },
59+
{
60+
code: 'ERR_ENCODING_NOT_SUPPORTED',
61+
name: 'RangeError'
62+
}
63+
);
64+
});
65+
}
66+
5467
// Test TextDecoder, UTF-8, fatal: true, ignoreBOM: false
5568
if (common.hasIntl) {
5669
['unicode-1-1-utf-8', 'utf8', 'utf-8'].forEach((i) => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.