diff options
author | 2022-03-18 20:06:14 -0700 | |
---|---|---|
committer | 2022-03-18 20:06:14 -0700 | |
commit | 0ed0fd2db098a25ab28a3b3ee189660e43241408 (patch) | |
tree | edf452779a5cc240fae77fc4eee552fc08e69347 /integration/bunjs-only-snippets/text-encoder.test.js | |
parent | f4eecd378230bda6b230227422ef9f4d1623ad2c (diff) | |
download | bun-0ed0fd2db098a25ab28a3b3ee189660e43241408.tar.gz bun-0ed0fd2db098a25ab28a3b3ee189660e43241408.tar.zst bun-0ed0fd2db098a25ab28a3b3ee189660e43241408.zip |
add an extra gcTrace
Diffstat (limited to 'integration/bunjs-only-snippets/text-encoder.test.js')
-rw-r--r-- | integration/bunjs-only-snippets/text-encoder.test.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/integration/bunjs-only-snippets/text-encoder.test.js b/integration/bunjs-only-snippets/text-encoder.test.js index ddba40d75..7c6a07efb 100644 --- a/integration/bunjs-only-snippets/text-encoder.test.js +++ b/integration/bunjs-only-snippets/text-encoder.test.js @@ -87,7 +87,7 @@ describe("TextEncoder", () => { } }); - it("should encode long latin1 text", () => { + it("should encode long latin1 text", async () => { const text = "Hello World!".repeat(1000); const encoder = new TextEncoder(); gcTrace(true); @@ -96,7 +96,12 @@ describe("TextEncoder", () => { expect(encoded instanceof Uint8Array).toBe(true); expect(encoded.length).toBe(text.length); gcTrace(true); - expect(new TextDecoder().decode(encoded)).toBe(text); + const decoded = new TextDecoder().decode(encoded); + expect(decoded).toBe(text); + gcTrace(); + await new Promise((resolve) => setTimeout(resolve, 1)); + gcTrace(); + expect(decoded).toBe(text); }); it("should encode latin1 rope text", () => { |