aboutsummaryrefslogtreecommitdiff
path: root/test/harness.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-03-19 19:09:16 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-03-19 19:09:16 -0700
commit9443cca1bb46bcb130fd4273f755b84b9411d382 (patch)
tree17d9e2a1b736c00f9849973d2319d59f1506c4cd /test/harness.ts
parenta83c5c996f46ae861962c8e8bf7042a8fa11130b (diff)
downloadbun-9443cca1bb46bcb130fd4273f755b84b9411d382.tar.gz
bun-9443cca1bb46bcb130fd4273f755b84b9411d382.tar.zst
bun-9443cca1bb46bcb130fd4273f755b84b9411d382.zip
Reduce number of module scopes created
Diffstat (limited to 'test/harness.ts')
-rw-r--r--test/harness.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/harness.ts b/test/harness.ts
index b3932129d..c82ecf698 100644
--- a/test/harness.ts
+++ b/test/harness.ts
@@ -1,6 +1,5 @@
import { gc as bunGC, unsafe } from "bun";
import { heapStats } from "bun:jsc";
-import { expect } from "bun:test";
export const bunEnv: any = {
...process.env,
@@ -30,7 +29,12 @@ export function gc(force = true) {
* @param maxWait
* @returns
*/
-export async function expectMaxObjectTypeCount(type: string, count: number, maxWait = 1000) {
+export async function expectMaxObjectTypeCount(
+ expect: typeof import("bun:test").expect,
+ type: string,
+ count: number,
+ maxWait = 1000,
+) {
gc();
if (heapStats().objectTypeCounts[type] <= count) return;
gc(true);