From 7a4affd01ec3a60aeb022172e5784506b945c044 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:07:59 -0700 Subject: [PATCH] globals, not global functions --- src/testSetup.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/testSetup.ts b/src/testSetup.ts index 799dbcb..8e1f4b8 100644 --- a/src/testSetup.ts +++ b/src/testSetup.ts @@ -33,7 +33,7 @@ declare module 'bun:test' { toMatchTree(expected: string): T toMatchExpression(expected: string): T toFailParse(): T - toEvaluateTo(expected: unknown, nativeFunctions?: Record): Promise + toEvaluateTo(expected: unknown, globals?: Record): Promise toFailEvaluation(): Promise } } @@ -96,13 +96,13 @@ expect.extend({ async toEvaluateTo( received: unknown, expected: unknown, - nativeFunctions: Record = {} + globals: Record = {} ) { assert(typeof received === 'string', 'toEvaluateTo can only be used with string values') try { const compiler = new Compiler(received) - const result = await run(compiler.bytecode, nativeFunctions) + const result = await run(compiler.bytecode, globals) let value = VMResultToValue(result) // Just treat regex as strings for comparison purposes