From d7ab2c04eca13cbe9cc8687d685037660daf5cf2 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 1 Dec 2022 23:42:13 -0800 Subject: Faster test --- test/bun.js/fetch.test.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test/bun.js') diff --git a/test/bun.js/fetch.test.js b/test/bun.js/fetch.test.js index af5de1b5a..65efc6ab5 100644 --- a/test/bun.js/fetch.test.js +++ b/test/bun.js/fetch.test.js @@ -1,7 +1,7 @@ import { it, describe, expect } from "bun:test"; import fs, { unlinkSync } from "fs"; import { mkfifo } from "mkfifo"; -import { gc } from "./gc"; +import { gc, withoutAggressiveGC } from "./gc"; const exampleFixture = fs.readFileSync( import.meta.path.substring(0, import.meta.path.lastIndexOf("/")) + @@ -218,12 +218,14 @@ function testBlobInterface(blobbyConstructor, hasBlobFn) { const compare = new Uint8Array(await response.arrayBuffer()); if (withGC) gc(); - for (let i = 0; i < compare.length; i++) { - if (withGC) gc(); + withoutAggressiveGC(() => { + for (let i = 0; i < compare.length; i++) { + if (withGC) gc(); - expect(compare[i]).toBe(bytes[i]); - if (withGC) gc(); - } + expect(compare[i]).toBe(bytes[i]); + if (withGC) gc(); + } + }); if (withGC) gc(); }); -- cgit v1.2.3