Skip to content

Commit

Permalink
test: improve test coverage for WHATWG TextDecoder
Browse files Browse the repository at this point in the history
Signed-off-by: Juan José Arboleda <[email protected]>
PR-URL: #45241
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
juanarbol committed Jan 31, 2023
1 parent 6317502 commit 1790569
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit 1790569

Please sign in to comment.