feat(@embark/site): add section on getting account from describe

This commit is contained in:
Jonathan Rainville 2019-06-17 11:50:05 -04:00
parent 332229ff9d
commit 5044403a03

View File

@ -161,7 +161,17 @@ config({
});
```
Notice that we're introducing a global `accounts` variable so we can mutate its state once the accounts are loaded. This is necessary to make the emitted accounts available in any of our spec blocks.
You can also grab the accounts from the callback of the `contract()` function (`describe` alias):
```
contract('SomeContract', (accounts) => {
const myAccounts = accounts[0];
it('should do something', async () => {
...
});
});
```
## Connecting to a different node