Here my test js file
const ApprovalContract = artifacts.require('../../contracts/ApprovalContract.sol');
contract('ApprovalContract' function (accounts) {
it('initiates contract', async function() {
const contract = await ApprovalContract.deployed();
const approver = await contract.approver.call();
assert.equal(approver, 0x3999BA5D247c800E5Ef3d4de66618741E3675379, "approver don't match");
});
})
truffle.js
and/ortruffle-config.js
)? Are you testing against ganache or a private network? The error message is saying your truffle configuration id doesn't matches the id returned by the network.module.exports = { networks: { development: { host: "127.0.0.1", port: 9545, network_id: "*" } } };
truffle-config.js location: D:\Desktop\BuildDapps 2\contracts truffle.js location: D:\Desktop\BuildDapps 2\contracts\testD:\Desktop\BuildDapps 2`, and you should execute truffle commands from that directory. You only need one config file in your proyect, either
truffle-config.js` ortruffle.js
.