Files
bch-js/test/integration/price.js
T

33 lines
768 B
JavaScript
Raw Normal View History

import chai from 'chai'
import BCHJS from '../../src/bch-js.js'
const { assert } = chai
2020-07-27 21:32:51 -07:00
const bchjs = new BCHJS()
2021-01-02 15:41:12 -08:00
describe('#price', () => {
beforeEach(async () => {
if (process.env.IS_USING_FREE_TIER) await sleep(1500)
})
2021-03-04 15:14:46 -04:00
describe('#getBchUsd', () => {
it('should get the USD price of BCH', async () => {
const result = await bchjs.Price.getBchUsd()
console.log(result)
assert.isNumber(result)
})
})
2020-11-17 14:41:04 -08:00
describe('#getPsffppPrice', () => {
it('should get the price of BCH in several currencies', async () => {
const result = await bchjs.Price.getPsffppPrice()
// console.log(result)
assert.isNumber(result)
})
})
2020-07-27 21:32:51 -07:00
})
2021-01-02 15:41:12 -08:00
function sleep (ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}