Issue with contract tests
See original GitHub issueHi guys!
I’m migrating my tests to embark framework and faced with one issue:
Seems like contract don’t have a address in time of tests execution, inspite of deployAll
call in before
:
var assert = require("assert");
var Embark = require("embark");
var EmbarkSpec = Embark.initTests();
var web3 = EmbarkSpec.web3;
describe("Unitoken", () => {
before((done) => {
var contractsConfig = {
"Unitoken": {
args: [100000, "Unitoken", 2, "UNI", "0x0"]
}
};
EmbarkSpec.deployAll(contractsConfig, done);
});
describe("#symbol()", () => {
it("should return correct value", (done) => {
console.log("deployed to: " + Unitoken.address)
Unitoken.symbol((err, result) => {
assert.equal(result, "UNI");
done();
});
});
});
});
and the result of this test:
> univereum@0.0.2 test /home/sayshay/source/univereum
> embark test
Unitoken
#symbol()
deployed to: undefined
1) should return correct value
0 passing (20s)
1 failing
1) Unitoken #symbol() should return correct value:
Error: invalid address
at inputAddressFormatter (node_modules/web3/lib/web3/formatters.js:271:11)
at inputCallFormatter (node_modules/web3/lib/web3/formatters.js:75:22)
at node_modules/web3/lib/web3/method.js:89:28
at Array.map (native)
at Method.formatInput (node_modules/web3/lib/web3/method.js:88:32)
at Method.toPayload (node_modules/web3/lib/web3/method.js:114:23)
at Eth.send [as call] (node_modules/web3/lib/web3/method.js:139:30)
at SolidityFunction.call (node_modules/web3/lib/web3/function.js:118:15)
at SolidityFunction.execute (node_modules/web3/lib/web3/function.js:238:22)
at Context.it (test/contract_spec.js:19:18)
Please notice deployed to: undefined
log output, which is refers to Unitoken.address
Am I doing something wrong?
Thanks in advance
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
What is Contract Testing & How is it Used? - Pactflow
can be unreliable or flakey. Because of the complexity in orchestrating a test environment, they can often fail, causing false-positives and ...
Read more >Introduction To Pact Contract Testing With Examples
Contract testing is a method to verify integration between two applications independently in order to test what has been passed and see if...
Read more >Your Contract Tests Are Not Protecting You | by Harry Martland
On numerous occasions I've heard people say they are doing contract tests or that contract testing can help solve their problems.
Read more >Why contract testing can be essential for microservices
The problem with microservices integration testing · Too many integrations to test. · Mismatched microservice versions. · Lack of clear testing ...
Read more >End-to-end vs. contract-based testing: How to choose
Contract -based tests typically won't detect endpoint configuration issues or misused classes. Other types of testing cover those errors and catch those types...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
can be fixed like this:
But it will be really nice if somebody will be able to improve auto gas calculation, so this dirty hack will not be needed 😃
Closing this as it’s somewhat outdated. Gas calculation and the testing framework is vastly improved in Status Embark 3.1 (http://embark.status.im/)