embark-area-51/test_app/test/lib_test_spec.js
2018-03-11 08:28:03 -04:00

58 lines
1.1 KiB
JavaScript

contract("Test", function() {
before(function(done) {
this.timeout(0);
var contractsConfig = {
"Test2": {
},
"Test": {
"gas": 2000000
},
"ZAMyLib": {
},
"ZAMyLib2": {
"deploy": true
},
"SimpleStorage": {
args: [100]
},
"AnotherStorage": {
args: ["$SimpleStorage"]
},
"Token": {
deploy: false,
args: [1000]
},
"MyToken": {
instanceOf: "Token"
},
"MyToken2": {
instanceOf: "Token",
args: [2000]
},
"ContractArgs": {
"args": {
"initialValue": 123,
"_addresses": ["$MyToken2", "$SimpleStorage"]
}
},
"SomeContract": {
"args": [
["$MyToken2", "$SimpleStorage"],
100
]
}
};
EmbarkSpec.deployAll(contractsConfig, () => { done() });
});
it("should call library correctly", function(done) {
Test2.methods.testAdd().call().then(function(result) {
assert.equal(result, 3);
done();
});
});
});