Skip to content

Commit

Permalink
fix(control): Adding integration tests for control library
Browse files Browse the repository at this point in the history
  • Loading branch information
christroutner committed Mar 8, 2020
1 parent d5b20fa commit 857449f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/integration/control.js
Original file line number Diff line number Diff line change
@@ -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 changes: 24 additions & 0 deletions test/integration/testnet/control.js
Original file line number Diff line number Diff line change
@@ -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")
})
})
})

0 comments on commit 857449f

Please sign in to comment.