Merge pull request #772 from embark-framework/expand_test

update examples
This commit is contained in:
Iuri Matias 2018-09-01 10:35:09 -04:00 committed by GitHub
commit 228eaef331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 4 deletions

View File

@ -1,12 +1,24 @@
// /*global contract, config, it, assert*/ // /*global contract, config, it, assert*/
/*const SimpleStorage = require('Embark/contracts/SimpleStorage'); /*
const SimpleStorage = require('Embark/contracts/SimpleStorage');
let accounts;
// For documentation please see https://embark.status.im/docs/contracts_testing.html
config({ config({
//deployment: {
// accounts: [
// // you can configure custom accounts with a custom balance
// // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
// ]
//},
contracts: { contracts: {
"SimpleStorage": { "SimpleStorage": {
args: [100] args: [100]
} }
} }
}, (_err, web3_accounts) => {
accounts = web3_accounts
}); });
contract("SimpleStorage", function () { contract("SimpleStorage", function () {
@ -22,4 +34,10 @@ contract("SimpleStorage", function () {
let result = await SimpleStorage.methods.get().call(); let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150); assert.strictEqual(parseInt(result, 10), 150);
}); });
});*/
it("should have account with balance", async function() {
let balance = await web3.eth.getBalance(accounts[0]);
assert.ok(parseInt(balance, 10) > 0);
});
}
*/

View File

@ -1,12 +1,23 @@
/*global contract, config, it, assert*/ /*global contract, config, it, assert*/
const SimpleStorage = require('Embark/contracts/SimpleStorage'); const SimpleStorage = require('Embark/contracts/SimpleStorage');
let accounts;
// For documentation please see https://embark.status.im/docs/contracts_testing.html
config({ config({
//deployment: {
// accounts: [
// // you can configure custom accounts with a custom balance
// // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
// ]
//},
contracts: { contracts: {
"SimpleStorage": { "SimpleStorage": {
args: [100] args: [100]
} }
} }
}, (_err, web3_accounts) => {
accounts = web3_accounts
}); });
contract("SimpleStorage", function () { contract("SimpleStorage", function () {
@ -22,4 +33,9 @@ contract("SimpleStorage", function () {
let result = await SimpleStorage.methods.get().call(); let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150); assert.strictEqual(parseInt(result, 10), 150);
}); });
it("should have account with balance", async function() {
let balance = await web3.eth.getBalance(accounts[0]);
assert.ok(parseInt(balance, 10) > 0);
});
}); });

View File

@ -1,12 +1,24 @@
// /*global contract, config, it, assert*/ // /*global contract, config, it, assert*/
/*const SimpleStorage = require('Embark/contracts/SimpleStorage'); /*
const SimpleStorage = require('Embark/contracts/SimpleStorage');
let accounts;
// For documentation please see https://embark.status.im/docs/contracts_testing.html
config({ config({
//deployment: {
// accounts: [
// // you can configure custom accounts with a custom balance
// // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
// ]
//},
contracts: { contracts: {
"SimpleStorage": { "SimpleStorage": {
args: [100] args: [100]
} }
} }
}, (_err, web3_accounts) => {
accounts = web3_accounts
}); });
contract("SimpleStorage", function () { contract("SimpleStorage", function () {
@ -22,4 +34,10 @@ contract("SimpleStorage", function () {
let result = await SimpleStorage.methods.get().call(); let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150); assert.strictEqual(parseInt(result, 10), 150);
}); });
});*/
it("should have account with balance", async function() {
let balance = await web3.eth.getBalance(accounts[0]);
assert.ok(parseInt(balance, 10) > 0);
});
}
*/