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 authored and RafaelGSS committed Jan 20, 2023
1 parent 58b836f commit bbf9da8
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 bbf9da8

Please sign in to comment.