Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improve test coverage for WHATWG TextDecoder
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
juanarbol committed Nov 8, 2022
commit 279a24b5d521acfe981b7b9f78b76ca1237257d7
13 changes: 13 additions & 0 deletions test/parallel/test-whatwg-encoding-custom-textdecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ assert(TextDecoder);
});
}

// Invalid encoders
{
['meow', 'nonunicode', 'foo', 'bar'].forEach((fakeEncoding) => {
assert.throws(
() => { new TextDecoder(fakeEncoding); },
{
code: 'ERR_ENCODING_NOT_SUPPORTED',
name: 'RangeError'
}
);
});
}

// Test TextDecoder, UTF-8, fatal: true, ignoreBOM: false
if (common.hasIntl) {
['unicode-1-1-utf-8', 'utf8', 'utf-8'].forEach((i) => {
Expand Down