Skip to content

Commit d98dbe1

Browse files
committed
Merge branch 'ct-local-integration' into ct-rawtransactions-unit
2 parents 6121679 + a54b6f2 commit d98dbe1

9 files changed

Lines changed: 50 additions & 9 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"test": "tsc && nyc mocha test/unit --timeout 60000 --exit",
1111
"test:no-build": "nyc mocha test/unit --timeout 60000 --exit",
1212
"test:integration": "TEST=integration nyc --reporter=text mocha --timeout 30000 test/integration",
13+
"test:integration:local": "TEST=integration SERVER=local nyc --reporter=text mocha --timeout 30000 test/integration --exit",
14+
"test:integration:stage": "TEST=integration SERVER=stage nyc --reporter=text mocha --timeout 30000 test/integration --exit",
1315
"coverage": "nyc report --reporter=text-lcov | coveralls",
1416
"build": "tsc"
1517
},

test/integration/address.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ const chai = require("chai")
1111
const assert = chai.assert
1212

1313
const BITBOX = require("../../lib/BITBOX").BITBOX
14-
const bitbox = new BITBOX()
15-
//const axios = require("axios")
14+
let bitbox = new BITBOX()
15+
16+
if (process.env.SERVER === "local")
17+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
18+
if (process.env.SERVER === "stage")
19+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1620

1721
// Inspect utility used for debugging.
1822
const util = require("util")

test/integration/block.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const chai = require("chai")
77
const assert = chai.assert
88

99
const BITBOX = require("../../lib/BITBOX").BITBOX
10-
const bitbox = new BITBOX()
10+
let bitbox = new BITBOX()
11+
12+
if (process.env.SERVER === "local")
13+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
14+
if (process.env.SERVER === "stage")
15+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1116

1217
// Inspect utility used for debugging.
1318
const util = require("util")

test/integration/blockchain.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ const chai = require("chai")
1111
const assert = chai.assert
1212

1313
const BITBOX = require("../../lib/BITBOX").BITBOX
14-
const bitbox = new BITBOX()
14+
let bitbox = new BITBOX()
15+
16+
if (process.env.SERVER === "local")
17+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
18+
if (process.env.SERVER === "stage")
19+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1520

1621
// Inspect utility used for debugging.
1722
const util = require("util")

test/integration/price.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const assert = require("assert")
22
const BITBOX = require("../../lib/BITBOX").BITBOX
3-
const bitbox = new BITBOX()
3+
let bitbox = new BITBOX()
4+
5+
if (process.env.SERVER === "local")
6+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
7+
if (process.env.SERVER === "stage")
8+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
49

510
describe("#price", () => {
611
describe("#current", () => {

test/integration/rawtransaction.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ const chai = require("chai")
99
const assert = chai.assert
1010

1111
const BITBOX = require("../../lib/BITBOX").BITBOX
12-
const bitbox = new BITBOX()
12+
let bitbox = new BITBOX()
13+
14+
if (process.env.SERVER === "local")
15+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
16+
if (process.env.SERVER === "stage")
17+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1318

1419
// Inspect utility used for debugging.
1520
const util = require("util")

test/integration/transaction.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const chai = require("chai")
77
const assert = chai.assert
88

99
const BITBOX = require("../../lib/BITBOX").BITBOX
10-
const bitbox = new BITBOX()
10+
let bitbox = new BITBOX()
11+
12+
if (process.env.SERVER === "local")
13+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
14+
if (process.env.SERVER === "stage")
15+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1116

1217
// Inspect utility used for debugging.
1318
const util = require("util")

test/integration/util.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const chai = require("chai")
77
const assert = chai.assert
88

99
const BITBOX = require("../../lib/BITBOX").BITBOX
10-
const bitbox = new BITBOX()
10+
let bitbox = new BITBOX()
11+
12+
if (process.env.SERVER === "local")
13+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
14+
if (process.env.SERVER === "stage")
15+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1116

1217
// Inspect utility used for debugging.
1318
const util = require("util")

test/integration/z9-rate-limits.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ const chai = require("chai")
88
const assert = chai.assert
99

1010
const BITBOX = require("../../lib/BITBOX").BITBOX
11-
const bitbox = new BITBOX()
11+
let bitbox = new BITBOX()
12+
13+
if (process.env.SERVER === "local")
14+
bitbox = new BITBOX({ restURL: "http://localhost:3000/v2/" })
15+
if (process.env.SERVER === "stage")
16+
bitbox = new BITBOX({ restURL: "https://rest.btctest.net/v2/" })
1217

1318
// Inspect utility used for debugging.
1419
const util = require("util")

0 commit comments

Comments
 (0)