I'm executing a example in this link. https://truffleframework.com/tutorials/pet-shop

While testing testing with file "TestAdoption.sol", I have encountered the error "Source truffle / Assert.sol not found".

pragma solidity ^0.4.17;

import "truffle/Assert.sol"; // error source truffle / Assert.sol not found"
import "truffle/DeployedAddresses.sol";// error source truffle/DeployedAddresses.sol not found"
import "../contracts/Adoption.sol";

contract TestAdoption {
  Adoption adoption = Adoption(DeployedAddresses.Adoption());


Any suggestions to solve the problem?


Typically your files will all lie in the contract folder beneath the truffle project root folder.

If the other contracts are in the same folder as this you need to change your import statements - ./ represents the current folder

import "./Assert.sol";
  • Sorry for not checking it out. Although the code line error, the compile still works well. It took me a long time to fix it. I hope the software development team will fix this error. – xPain Jun 29 '18 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.