diff --git a/compiler/wasm/test/node/index.test.ts b/compiler/wasm/test/node/index.test.ts index 78aed535df7..4ec6d83c3c3 100644 --- a/compiler/wasm/test/node/index.test.ts +++ b/compiler/wasm/test/node/index.test.ts @@ -4,19 +4,18 @@ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { compile } from '@noir-lang/noir_wasm'; -async function getFileContent(path: string): Promise { - return readFileSync(join(__dirname, path)).toString(); -} +const absoluteNoirSourcePath = join(__dirname, noirSourcePath); +const absoluteNargoArtifactPath = join(__dirname, nargoArtifactPath); // eslint-disable-next-line @typescript-eslint/no-explicit-any async function getPrecompiledSource(): Promise { - const compiledData = await getFileContent(nargoArtifactPath); + const compiledData = readFileSync(absoluteNargoArtifactPath).toString(); return JSON.parse(compiledData); } describe('noir wasm compilation', () => { it('matches nargos compilation', async () => { - const wasmCircuit = await compile(noirSourcePath); + const wasmCircuit = await compile(absoluteNoirSourcePath); const cliCircuit = await getPrecompiledSource(); // We don't expect the hashes to match due to how `noir_wasm` handles dependencies