Skip to content

Commit

Permalink
fix: update tests to use new compile return type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Oct 30, 2023
1 parent 8cb4aba commit ce0f3a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ async function getCircuit(noirSource: string) {
});

// We're ignoring this in the resolver but pass in something sensible.
return compile('/main.nr');
const result = compile('/main.nr');
if (!('program' in result)) {
throw new Error('Compilation failed');
}

return result.program;
}

test_cases.forEach((testInfo) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ test_cases.forEach((testInfo) => {

const noir_source_path = resolve(`${base_relative_path}/${test_case}/src/main.nr`);

const noir_program = compile(noir_source_path);
const compileResult = compile(noir_source_path);
if (!('program' in compileResult)) {
throw new Error('Compilation failed');
}

const noir_program = compileResult.program;

const backend = new BarretenbergBackend(noir_program);
const program = new Noir(noir_program, backend);
Expand Down

0 comments on commit ce0f3a9

Please sign in to comment.