Skip to content

Commit

Permalink
improved testnet integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christroutner committed Mar 8, 2020
1 parent 8d4ff09 commit 71c4d6f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion test/integration/testnet/blockbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions test/integration/testnet/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 6 additions & 1 deletion test/integration/testnet/openbazaar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`, () => {
Expand Down
6 changes: 4 additions & 2 deletions test/integration/testnet/rawtransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions test/integration/testnet/slp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions test/integration/testnet/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 71c4d6f

Please sign in to comment.