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