diff options
-rw-r--r-- | test/js/web/encoding/text-decoder.test.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/js/web/encoding/text-decoder.test.js b/test/js/web/encoding/text-decoder.test.js index de71fb351..3685a5f6d 100644 --- a/test/js/web/encoding/text-decoder.test.js +++ b/test/js/web/encoding/text-decoder.test.js @@ -266,25 +266,24 @@ describe("TextDecoder", () => { }); describe("TextDecoder ignoreBOM", () => { - it.each([ { - encoding: 'utf-8', - bytes: [0xEF, 0xBB, 0xBF, 0x61, 0x62, 0x63] + encoding: "utf-8", + bytes: [0xef, 0xbb, 0xbf, 0x61, 0x62, 0x63], }, { - encoding: 'utf-16le', - bytes: [0xFF, 0xFE, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00] - } - ])('should ignoreBOM for: %o', ({encoding, bytes}) => { - const BOM = '\uFEFF'; + encoding: "utf-16le", + bytes: [0xff, 0xfe, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00], + }, + ])("should ignoreBOM for: %o", ({ encoding, bytes }) => { + const BOM = "\uFEFF"; const array = new Uint8Array(bytes); - const decoder_ignore_bom = new TextDecoder(encoding, {ignoreBOM: true}); + const decoder_ignore_bom = new TextDecoder(encoding, { ignoreBOM: true }); expect(decoder_ignore_bom.decode(array)).toStrictEqual(`${BOM}abc`); - const decoder_not_ignore_bom = new TextDecoder(encoding, {ignoreBOM: false}); - expect(decoder_not_ignore_bom.decode(array)).toStrictEqual('abc'); + const decoder_not_ignore_bom = new TextDecoder(encoding, { ignoreBOM: false }); + expect(decoder_not_ignore_bom.decode(array)).toStrictEqual("abc"); }); }); |