From 857449f0d1fdc5b515f37d372217c06cecc0e794 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Mar 2020 10:03:20 -0700 Subject: [PATCH] fix(control): Adding integration tests for control library --- test/integration/control.js | 19 +++++++++++++++++++ test/integration/testnet/control.js | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/integration/control.js create mode 100644 test/integration/testnet/control.js diff --git a/test/integration/control.js b/test/integration/control.js new file mode 100644 index 0000000..447f85c --- /dev/null +++ b/test/integration/control.js @@ -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") + }) + }) +}) diff --git a/test/integration/testnet/control.js b/test/integration/testnet/control.js new file mode 100644 index 0000000..be04826 --- /dev/null +++ b/test/integration/testnet/control.js @@ -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") + }) + }) +})