mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
34 lines
866 B
JavaScript
34 lines
866 B
JavaScript
const assert = require("chai").assert
|
|
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)
|
|
})
|
|
})
|
|
})
|
|
|
|
describe("#getUsd", () => {
|
|
it("should get the USD price of BCH", async () => {
|
|
const result = await bchjs.Price.getUsd()
|
|
// console.log(result)
|
|
|
|
assert.isNumber(result)
|
|
})
|
|
})
|
|
|
|
describe("#rates", () => {
|
|
it("should get the price of BCH in several currencies", async () => {
|
|
const result = await bchjs.Price.rates()
|
|
// console.log(result)
|
|
|
|
assert.property(result, "USD")
|
|
assert.property(result, "CAD")
|
|
})
|
|
})
|
|
})
|