diff options
author | 2022-12-01 23:42:13 -0800 | |
---|---|---|
committer | 2022-12-01 23:42:13 -0800 | |
commit | d7ab2c04eca13cbe9cc8687d685037660daf5cf2 (patch) | |
tree | 8543af9b4559fe43d6c819fb4d44cfe0c903cb5a /test/bun.js/fetch.test.js | |
parent | f84f77d1ed171183accbc99b2dac22d45312f388 (diff) | |
download | bun-d7ab2c04eca13cbe9cc8687d685037660daf5cf2.tar.gz bun-d7ab2c04eca13cbe9cc8687d685037660daf5cf2.tar.zst bun-d7ab2c04eca13cbe9cc8687d685037660daf5cf2.zip |
Faster test
Diffstat (limited to 'test/bun.js/fetch.test.js')
-rw-r--r-- | test/bun.js/fetch.test.js | 14 |
1 files changed, 8 insertions, 6 deletions
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(); }); |