Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

test: throw if test contracts fail compilation #633

Merged
merged 2 commits into from
Sep 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/helpers/contract/compileAndDeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function compile(mainContractName, contractFileNames = [], contractSubdirectory,

const result = JSON.parse(solc.compile(JSON.stringify(input)));

if (result.errors) {
const errorMessages = result.errors.map((error) => error.formattedMessage);
throw new Error(`Could not compile test contracts:\n${errorMessages.join("")}`);
}

const _mainContractName = mainContractName.endsWith(".sol")
? mainContractName.replace(/\.sol$/i, "")
: mainContractName;
Expand Down