2020-10-19 19:36:55 -07:00
|
|
|
const assert = require("chai").assert
|
2020-07-27 21:32:51 -07:00
|
|
|
const BCHJS = require("../../src/bch-js")
|
|
|
|
|
const bchjs = new BCHJS()
|
|
|
|
|
|
|
|
|
|
describe("#price", () => {
|
|
|
|
|
describe("#current", () => {
|
|
|
|
|
describe("#single currency", () => {
|
|
|
|
|
it("should get current price for single currency", async () => {
|
|
|
|
|
const result = await bchjs.Price.current("usd")
|
|
|
|
|
assert.notEqual(0, result)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
2020-10-19 19:36:55 -07:00
|
|
|
|
|
|
|
|
describe("#getUsd", () => {
|
|
|
|
|
it("should get the USD price of BCH", async () => {
|
|
|
|
|
const result = await bchjs.Price.getUsd()
|
|
|
|
|
// console.log(result)
|
|
|
|
|
|
|
|
|
|
assert.isNumber(result.usd)
|
|
|
|
|
})
|
|
|
|
|
})
|
2020-07-27 21:32:51 -07:00
|
|
|
})
|