-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(control): Adding integration tests for control library
- Loading branch information
1 parent
d5b20fa
commit 857449f
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
}) | ||
}) | ||
}) |