Merge pull request #13 from christroutner/unstable

fix(control): Adding integration tests for control library
This commit is contained in:
Chris Troutner
2020-03-08 10:06:04 -07:00
committed by GitHub
2 changed files with 43 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
/*
Integration tests for bchjs control library.
*/
const chai = require("chai")
const assert = chai.assert
const BCHJS = require("../../src/bch-js")
const bchjs = new BCHJS()
describe(`#control`, () => {
describe(`#getNetworkInfo`, () => {
it("should get info on the full node", async () => {
const result = await bchjs.Control.getNetworkInfo()
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.property(result, "version")
})
})
})
+24
View File
@@ -0,0 +1,24 @@
/*
Integration tests for bchjs control library.
*/
const chai = require("chai")
const assert = chai.assert
const RESTURL = process.env.RESTURL
? process.env.RESTURL
: `https://tapi.fullstack.cash/v3/`
const BCHJS = require("../../../src/bch-js")
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
describe(`#control`, () => {
describe(`#getNetworkInfo`, () => {
it("should get info on the full node", async () => {
const result = await bchjs.Control.getNetworkInfo()
// console.log(`result: ${JSON.stringify(result, null, 2)}`)
assert.property(result, "version")
})
})
})