I am having trouble with my JS tests for a Contract which depends on the deployment of another Contract first.
Contract A needs to be deployed, then pass it's address to Contract B.
I have already been able to migrate successfully, but still trying to get the tests to pass.
How do I fix my JS tests and instantiate/deploy properly?
Here is my test code:
beforeEach(async function() {
let tx = await ContractA.deployed();
contractB = await ContractB.deployed(tx.address);
});
Deployment script:
module.exports = function(deployer) {
deployer.deploy(ContractA).then(function() {
deployer.deploy(ContractB, ContractA.address);
});
};
Receiving this error:
Error: ContractB has not been deployed to detected network (network/artifact mismatch)