diff --git a/package.json b/package.json index 19867f4..bbb0994 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "test:integration": "mocha --timeout 30000 test/integration", "test:integration:testnet": "mocha --timeout 30000 test/integration/testnet", "test:integration:local": "RESTURL=http://localhost:3000/v3/ mocha --timeout 30000 test/integration", + "test:integration:testnet:local": "RESTURL=http://localhost:4000/v3/ mocha --timeout 30000 test/integration/testnet", "test:integration:api": "RESTURL=https://api.fullstack.cash/v3/ mocha --timeout 30000 test/integration", "coverage": "nyc report --reporter=text-lcov | coveralls", "docs": "./node_modules/.bin/apidoc -i src/ -o docs" diff --git a/test/integration/testnet/blockbook.js b/test/integration/testnet/blockbook.js index 6b067a3..d286f6e 100644 --- a/test/integration/testnet/blockbook.js +++ b/test/integration/testnet/blockbook.js @@ -6,7 +6,9 @@ const chai = require("chai") const assert = chai.assert -const RESTURL = `https://tapi.fullstack.cash/v3/` +const RESTURL = process.env.RESTURL + ? process.env.RESTURL + : `https://tapi.fullstack.cash/v3/` // if (process.env.RESTURL) RESTURL = process.env.RESTURL const BCHJS = require("../../../src/bch-js") diff --git a/test/integration/testnet/blockchain.js b/test/integration/testnet/blockchain.js index 339c48d..c7e13a3 100644 --- a/test/integration/testnet/blockchain.js +++ b/test/integration/testnet/blockchain.js @@ -10,12 +10,14 @@ const chai = require("chai") const assert = chai.assert -const RESTURL = `https://tapi.fullstack.cash/v3/` +const RESTURL = process.env.RESTURL + ? process.env.RESTURL + : `https://tapi.fullstack.cash/v3/` // if (process.env.RESTURL) RESTURL = process.env.RESTURL const BCHJS = require("../../../src/bch-js") // const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v3/` }) -const bchjs = new BCHJS({ restURL: RESTURL }) +const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN }) // Inspect utility used for debugging. const util = require("util") diff --git a/test/integration/testnet/openbazaar.js b/test/integration/testnet/openbazaar.js index a1f079c..9d02775 100644 --- a/test/integration/testnet/openbazaar.js +++ b/test/integration/testnet/openbazaar.js @@ -7,8 +7,13 @@ process.env.NETWORK = "testnet" 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() +const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN }) describe(`#OpenBazaar`, () => { describe(`#Balance`, () => { diff --git a/test/integration/testnet/rawtransaction.js b/test/integration/testnet/rawtransaction.js index 7250e59..97a2c9f 100644 --- a/test/integration/testnet/rawtransaction.js +++ b/test/integration/testnet/rawtransaction.js @@ -8,12 +8,14 @@ const chai = require("chai") const assert = chai.assert -const RESTURL = `https://tapi.fullstack.cash/v3/` +const RESTURL = process.env.RESTURL + ? process.env.RESTURL + : `https://tapi.fullstack.cash/v3/` // if (process.env.RESTURL) RESTURL = process.env.RESTURL const BCHJS = require("../../../src/bch-js") // const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v3/` }) -const bchjs = new BCHJS({ restURL: RESTURL }) +const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN }) // Inspect utility used for debugging. const util = require("util") diff --git a/test/integration/testnet/slp.js b/test/integration/testnet/slp.js index e9afd9a..46bea98 100644 --- a/test/integration/testnet/slp.js +++ b/test/integration/testnet/slp.js @@ -5,12 +5,14 @@ const chai = require("chai") const assert = chai.assert -const RESTURL = `https://tapi.fullstack.cash/v3/` +const RESTURL = process.env.RESTURL + ? process.env.RESTURL + : `https://tapi.fullstack.cash/v3/` // if (process.env.RESTURL) RESTURL = process.env.RESTURL const BCHJS = require("../../../src/bch-js") // const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v3/` }) -const bchjs = new BCHJS({ restURL: RESTURL }) +const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN }) // Inspect utility used for debugging. const util = require("util") diff --git a/test/integration/testnet/util.js b/test/integration/testnet/util.js index 755f937..e3096e9 100644 --- a/test/integration/testnet/util.js +++ b/test/integration/testnet/util.js @@ -6,12 +6,14 @@ const chai = require("chai") const assert = chai.assert -const RESTURL = `https://tapi.fullstack.cash/v3/` +const RESTURL = process.env.RESTURL + ? process.env.RESTURL + : `https://tapi.fullstack.cash/v3/` // if (process.env.RESTURL) RESTURL = process.env.RESTURL const BCHJS = require("../../../src/bch-js") // const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v3/` }) -const bchjs = new BCHJS({ restURL: RESTURL }) +const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN }) // Inspect utility used for debugging. const util = require("util")