embark-area-51/test_apps/coverage_app/test/branches_spec.js

36 lines
930 B
JavaScript
Raw Normal View History

2018-08-21 19:25:18 +00:00
/*global contract, config, it, assert*/
const Branches = require('Embark/contracts/Branches');
config({
contracts: {
"Branches": {
args: [5]
}
}
});
contract("Branches", function() {
it("should return the bigger value and set it", function(done) {
Branches.methods.bigger(10).send().then(() => {
Branches.methods.get().call().then((result) => {
assert.strictEqual(parseInt(result, 10), 10);
done();
});
});
});
it("should return the set number if it's bigger", function(done) {
Branches.methods.bigger(1).send().then(() => {
done();
});
});
it("should return the smaller number", function(done) {
2018-08-21 20:23:00 +00:00
Branches.methods.smaller(10).send().then(() => { done(); });
2018-08-21 19:25:18 +00:00
});
it("should not crash code coverage on `if` without statements", function(done) {
Branches.methods.smallFunctionWithoutStatements().call().then(() => { done(); });
});
2018-08-21 19:25:18 +00:00
});