binance-api-lightweight
Version:
A super-speedy lightweight wrapper for Binance API
33 lines (26 loc) • 692 B
JavaScript
import test from "ava";
import BinanceAPI from "../src";
var client = new BinanceAPI("s", "a");
test('No exceptions thrown then client instantiates', t => {
try {
client = new BinanceAPI("d", "s");
} catch (e) {
t.is(e.message)
}
t.pass();
});
test('history', async t => {
try {
client.history("BTC");
} catch (e) {
t.is(e.message)
}
const book = JSON.parse(client.history("BTC"));
t.truthy(book.url);
t.truthy(book.timeout);
t.truthy(book.verify);
t.truthy(typeof book.url === 'string');
t.truthy(typeof book.timeout === 'number');
t.truthy(typeof book.verify === 'boolean');
t.pass();
})