Created
June 30, 2017 18:53
-
-
Save sogoiii/f9664a547fd7baf800c1805f8b460a37 to your computer and use it in GitHub Desktop.
Comparing simple truffle test as promise chain or async/await
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const status = () => { | |
return MetaCoin.deployed() | |
.then(instance => { | |
return instance.getBalance.call(accounts[0]); | |
}) | |
.then(balance => { | |
assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account"); | |
}) | |
} | |
const status2 = function async () { | |
let meta = await MetaCoin.deployed(); | |
let balance = await meta.getBalance.call(accounts[0]); | |
assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment