OSDN Git Service

add the test case for node-sdk
[bytom/bytom-node-sdk.git] / test / balances.js
1 /* eslint-env mocha */
2
3 const chai = require('chai')
4 const chaiAsPromised = require('chai-as-promised')
5 chai.use(chaiAsPromised)
6 const expect = chai.expect
7
8 const {
9   client
10 } = require('./testHelpers')
11
12 describe('Balance', () => {
13
14   describe('list by specific account', () => {
15     it('simple example', () =>
16       client.balances.list({
17         account_alias: 'default',
18       }).then(items =>
19         expect(items[0].amount).not.to.be.empty
20       )
21     )
22   })
23
24   describe('listAll', () => {
25     it('simple example', () => {
26       return client.balances.listAll().then((resp) => {
27         expect(resp.find(b => b.account_alias == 'default').amount).not.to.be.empty
28       })
29     })
30   })
31
32 })