From b42675e1d9976a2f72f9a86ea6a43b86db36a53e Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sun, 26 Oct 2025 12:29:14 -0700 Subject: [PATCH] narrow type --- src/testSetup.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/testSetup.ts b/src/testSetup.ts index 799dbcb..416edcd 100644 --- a/src/testSetup.ts +++ b/src/testSetup.ts @@ -3,7 +3,7 @@ import { parser } from '#parser/shrimp' import { $ } from 'bun' import { assert, errorMessage } from '#utils/utils' import { Compiler } from '#compiler/compiler' -import { run, VM } from 'reefvm' +import { run, VM, type TypeScriptFunction } from 'reefvm' import { treeToString, VMResultToValue } from '#utils/tree' const regenerateParser = async () => { @@ -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, globalFunctions?: Record): Promise toFailEvaluation(): Promise } } @@ -96,13 +96,13 @@ expect.extend({ async toEvaluateTo( received: unknown, expected: unknown, - nativeFunctions: Record = {} + globalFunctions: 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, globalFunctions) let value = VMResultToValue(result) // Just treat regex as strings for comparison purposes