aboutsummaryrefslogtreecommitdiff
path: root/test/js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-21 07:10:07 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-21 07:10:07 -0700
commitabfc10afeb73f9447e47929359d37f2b488c3c81 (patch)
tree6f17b77422194eb4aa829bd1e85b62ca1df333c7 /test/js
parenta18ef053a42779138ab1b8bfbcba362ff65e04eb (diff)
downloadbun-abfc10afeb73f9447e47929359d37f2b488c3c81.tar.gz
bun-abfc10afeb73f9447e47929359d37f2b488c3c81.tar.zst
bun-abfc10afeb73f9447e47929359d37f2b488c3c81.zip
Revert "feat(encoding): support BOM detection (#5550)"
This reverts commit 5f66b4e729105286863a13955b1ed8897b45210e. This caused test failures in text-encoder. cc @WingLim
Diffstat (limited to 'test/js')
-rw-r--r--test/js/web/encoding/text-decoder.test.js24
1 files changed, 1 insertions, 23 deletions
diff --git a/test/js/web/encoding/text-decoder.test.js b/test/js/web/encoding/text-decoder.test.js
index 3685a5f6d..dabdb0936 100644
--- a/test/js/web/encoding/text-decoder.test.js
+++ b/test/js/web/encoding/text-decoder.test.js
@@ -250,7 +250,7 @@ describe("TextDecoder", () => {
it("constructor should set values", () => {
const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: false });
expect(decoder.fatal).toBe(true);
- expect(decoder.ignoreBOM).toBe(false);
+ // expect(decoder.ignoreBOM).toBe(false); // currently the getter for ignoreBOM doesn't work and always returns undefined
});
it("should throw on invalid input", () => {
@@ -265,28 +265,6 @@ describe("TextDecoder", () => {
});
});
-describe("TextDecoder ignoreBOM", () => {
- it.each([
- {
- 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";
- const array = new Uint8Array(bytes);
-
- 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");
- });
-});
-
it("truncated sequences", () => {
const assert_equals = (a, b) => expect(a).toBe(b);