“Truffle test” fails - Could not find artifacts for xxxx from any sources


Bump into this issue and the solution to to "ensure your test contract name matches your contract filename.

For example, this is where you will get an error

TestLandContract.sol

contract TestLandContractOhCrap {

LandContract targetContract = LandContract(DeployedAddresses.LandContract());

function test() public {

uint data = 8;
Assert.equal(8, data, "Adoption of pet ID 8 should be recorded.");
}

}


No error

TestLandContract.sol

contract TestLandContract {

LandContract targetContract = LandContract(DeployedAddresses.LandContract());

function test() public {

uint data = 8;
Assert.equal(8, data, "Adoption of pet ID 8 should be recorded.");
}

}

Comments

Popular posts from this blog

ionic2 cordova build android - Unable resolve gradle 2.2.3

A quick tutorial for OWASP ZAP tool for beginners