2020-07-27 21:32:51 -07:00
|
|
|
/*
|
|
|
|
|
Integration tests for bchjs control library.
|
|
|
|
|
*/
|
|
|
|
|
|
2021-01-02 15:41:12 -08:00
|
|
|
const chai = require('chai')
|
2020-07-27 21:32:51 -07:00
|
|
|
const assert = chai.assert
|
2021-01-02 15:41:12 -08:00
|
|
|
const BCHJS = require('../../src/bch-js')
|
2020-07-27 21:32:51 -07:00
|
|
|
const bchjs = new BCHJS()
|
|
|
|
|
|
2021-01-02 15:41:12 -08:00
|
|
|
describe('#control', () => {
|
2020-11-02 14:49:28 -08:00
|
|
|
beforeEach(async () => {
|
2021-08-09 14:54:49 -07:00
|
|
|
if (process.env.IS_USING_FREE_TIER) await sleep(1500)
|
2020-11-02 14:49:28 -08:00
|
|
|
})
|
|
|
|
|
|
2021-01-02 15:41:12 -08:00
|
|
|
describe('#getNetworkInfo', () => {
|
|
|
|
|
it('should get info on the full node', async () => {
|
2020-07-27 21:32:51 -07:00
|
|
|
const result = await bchjs.Control.getNetworkInfo()
|
2023-02-07 10:01:41 -08:00
|
|
|
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
2020-07-27 21:32:51 -07:00
|
|
|
|
2021-01-02 15:41:12 -08:00
|
|
|
assert.property(result, 'version')
|
2020-07-27 21:32:51 -07:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
2020-11-02 14:49:28 -08:00
|
|
|
|
2021-01-02 15:41:12 -08:00
|
|
|
function sleep (ms) {
|
2020-11-02 14:49:28 -08:00
|
|
|
return new Promise(resolve => setTimeout(resolve, ms))
|
|
|
|
|
}
|