update tests

This commit is contained in:
Iuri Matias 2018-01-12 18:11:24 -05:00
parent 34c6b74315
commit 55bb4cc4e8
2 changed files with 17 additions and 15 deletions

View File

@ -1,28 +1,29 @@
// describe("SimpleStorage", function() { //describe("SimpleStorage", function() {
// this.timeout(0);
// before(function(done) { // before(function(done) {
// this.timeout(0); // this.timeout(0);
// var contractsConfig = { // var contractsConfig = {
// "SimpleStorage": { // "SimpleStorage": {
// args: [100, '0x123'] // args: [100]
// } // }
// }; // };
// EmbarkSpec.deployAll(contractsConfig, done); // EmbarkSpec.deployAll(contractsConfig, () => { done() });
// }); // });
// //
// it("should set constructor value", function(done) { // it("should set constructor value", function(done) {
// SimpleStorage.storedData(function(err, result) { // SimpleStorage.methods.storedData().call().then(function(result) {
// assert.equal(result.toNumber(), 100); // assert.equal(result, 100);
// done(); // done();
// }); // });
// }); // });
// //
// it("set storage value", function(done) { // it("set storage value", function(done) {
// SimpleStorage.set(150, function() { // SimpleStorage.methods.set(150).send().then(function() {
// SimpleStorage.get(function(err, result) { // SimpleStorage.methods.get().call().then(function(result) {
// assert.equal(result.toNumber(), 150); // assert.equal(result, 150);
// done(); // done();
// }); // });
// }); // });
// }); // });
// //
// }); //});

View File

@ -1,4 +1,5 @@
describe("SimpleStorage", function() { describe("SimpleStorage", function() {
this.timeout(0);
before(function(done) { before(function(done) {
this.timeout(0); this.timeout(0);
var contractsConfig = { var contractsConfig = {
@ -6,20 +7,20 @@ describe("SimpleStorage", function() {
args: [100] args: [100]
} }
}; };
EmbarkSpec.deployAll(contractsConfig, done); EmbarkSpec.deployAll(contractsConfig, () => { done() });
}); });
it("should set constructor value", function(done) { it("should set constructor value", function(done) {
SimpleStorage.storedData(function(err, result) { SimpleStorage.methods.storedData().call().then(function(result) {
assert.equal(result.toNumber(), 100); assert.equal(result, 100);
done(); done();
}); });
}); });
it("set storage value", function(done) { it("set storage value", function(done) {
SimpleStorage.set(150, function() { SimpleStorage.methods.set(150).send().then(function() {
SimpleStorage.get(function(err, result) { SimpleStorage.methods.get().call().then(function(result) {
assert.equal(result.toNumber(), 150); assert.equal(result, 150);
done(); done();
}); });
}); });