mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-21 11:09:09 +00:00
1d6da99e8f
display last line on tx fix debugger call listen to source event only after jumping to the end keep track of last tx; add minimal debug feature; fix ast issue initial debugger apis & ui integration prevent crash when step is out of bounds; send all all available data in websocket add debugger commands fix line number tracking in editor; toggle breakpoints replace timeouts with callbacks add debugger manager & refactor refactor debugger api refactor cmd line debugger reduce debugger decoupling reduce debugger decoupling fix debug buttons trigger source update so api triggers ws event to update source location move locals and contracts vars to a json view improve debugger icons simplify debugger data update debug package add command handler to get a contract given a tx; update debugger so it can get a contract by its tx instead of tracking latest txs only update debugger package
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/*global contract, config, it, assert*/
|
|
const SimpleStorage = require('Embark/contracts/SimpleStorage');
|
|
|
|
let accounts;
|
|
|
|
// For documentation please see https://embark.status.im/docs/contracts_testing.html
|
|
config({
|
|
//deployment: {
|
|
// accounts: [
|
|
// // you can configure custom accounts with a custom balance
|
|
// // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
|
|
// ]
|
|
//},
|
|
contracts: {
|
|
"SimpleStorage": {
|
|
args: [100]
|
|
}
|
|
}
|
|
}, (_err, web3_accounts) => {
|
|
accounts = web3_accounts
|
|
});
|
|
|
|
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);
|
|
});
|
|
|
|
it("should have account with balance", async function() {
|
|
let balance = await web3.eth.getBalance(accounts[0]);
|
|
assert.ok(parseInt(balance, 10) > 0);
|
|
});
|
|
});
|