update tests in templates

This commit is contained in:
Jonathan Rainville 2018-06-18 15:15:24 -04:00
parent c25bf086f9
commit 3d9a006ecc
3 changed files with 66 additions and 63 deletions

View File

@ -1,24 +1,25 @@
//describe("SimpleStorage", function() {
// this.timeout(0);
// before(function(done) {
// this.timeout(0);
// var contractsConfig = {
// "SimpleStorage": {
// args: [100]
// }
// };
// EmbarkSpec.deployAll(contractsConfig, () => { done() });
// });
//
// it("should set constructor value", async function() {
// let result = await SimpleStorage.methods.storedData().call();
// assert.equal(result, 100);
// });
//
// it("set storage value", async function() {
// await SimpleStorage.methods.set(150).send();
// let result = await SimpleStorage.methods.get().call();
// assert.equal(result, 150);
// });
//
//});
// /*global contract, config, it, assert*/
/*const SimpleStorage = require('Embark/contracts/SimpleStorage');
config({
contracts: {
"SimpleStorage": {
args: [100]
}
}
});
contract("SimpleStorage", function () {
this.timeout(0);
it("should set constructor value", async function () {
let result = await SimpleStorage.methods.storedData().call();
assert.strictEqual(parseInt(result, 10), 100);
});
it("set storage value", async function () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150);
});
});*/

View File

@ -1,24 +1,25 @@
describe("SimpleStorage", function() {
this.timeout(0);
before(function(done) {
this.timeout(0);
var contractsConfig = {
/*global contract, config, it, assert*/
const SimpleStorage = require('Embark/contracts/SimpleStorage');
config({
contracts: {
"SimpleStorage": {
args: [100]
}
};
EmbarkSpec.deployAll(contractsConfig, () => { done() });
});
}
});
it("should set constructor value", async function() {
contract("SimpleStorage", function () {
this.timeout(0);
it("should set constructor value", async function () {
let result = await SimpleStorage.methods.storedData().call();
assert.equal(result, 100);
assert.strictEqual(parseInt(result, 10), 100);
});
it("set storage value", async function() {
it("set storage value", async function () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.equal(result, 150);
assert.strictEqual(parseInt(result, 10), 150);
});
});

View File

@ -1,24 +1,25 @@
//describe("SimpleStorage", function() {
// this.timeout(0);
// before(function(done) {
// this.timeout(0);
// var contractsConfig = {
// "SimpleStorage": {
// args: [100]
// }
// };
// EmbarkSpec.deployAll(contractsConfig, () => { done() });
// });
//
// it("should set constructor value", async function() {
// let result = await SimpleStorage.methods.storedData().call();
// assert.equal(result, 100);
// });
//
// it("set storage value", async function() {
// await SimpleStorage.methods.set(150).send();
// let result = await SimpleStorage.methods.get().call();
// assert.equal(result, 150);
// });
//
//});
// /*global contract, config, it, assert*/
/*const SimpleStorage = require('Embark/contracts/SimpleStorage');
config({
contracts: {
"SimpleStorage": {
args: [100]
}
}
});
contract("SimpleStorage", function () {
this.timeout(0);
it("should set constructor value", async function () {
let result = await SimpleStorage.methods.storedData().call();
assert.strictEqual(parseInt(result, 10), 100);
});
it("set storage value", async function () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150);
});
});*/