aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/text-decoder.test.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/bun.js/text-decoder.test.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/bun.js/text-decoder.test.js b/test/bun.js/text-decoder.test.js
index 2a88a8bc8..bc10bf649 100644
--- a/test/bun.js/text-decoder.test.js
+++ b/test/bun.js/text-decoder.test.js
@@ -1,5 +1,5 @@
import { expect, it, describe } from "bun:test";
-import { gc as gcTrace } from "./gc";
+import { gc as gcTrace, withoutAggressiveGC } from "./gc";
const getByteLength = (str) => {
// returns the byte length of an utf8 string
@@ -74,10 +74,12 @@ describe("TextDecoder", () => {
it("DOMJIT call", () => {
const array = new Uint8Array(bytes.buffer);
- for (let i = 0; i < 100_000; i++) {
- const decoded = decoder.decode(array);
- expect(decoded).toBe(text);
- }
+ withoutAggressiveGC(() => {
+ for (let i = 0; i < 100_000; i++) {
+ const decoded = decoder.decode(array);
+ expect(decoded).toBe(text);
+ }
+ });
});
});