File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 },
Original file line number Diff line number Diff line change @@ -11,8 +11,12 @@ const chai = require("chai")
1111const assert = chai . assert
1212
1313const 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.
1822const util = require ( "util" )
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ const chai = require("chai")
77const assert = chai . assert
88
99const 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.
1318const util = require ( "util" )
Original file line number Diff line number Diff line change @@ -11,7 +11,12 @@ const chai = require("chai")
1111const assert = chai . assert
1212
1313const 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.
1722const util = require ( "util" )
Original file line number Diff line number Diff line change 11const assert = require ( "assert" )
22const 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
510describe ( "#price" , ( ) => {
611 describe ( "#current" , ( ) => {
Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ const chai = require("chai")
99const assert = chai . assert
1010
1111const 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.
1520const util = require ( "util" )
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ const chai = require("chai")
77const assert = chai . assert
88
99const 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.
1318const util = require ( "util" )
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ const chai = require("chai")
77const assert = chai . assert
88
99const 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.
1318const util = require ( "util" )
Original file line number Diff line number Diff line change @@ -8,7 +8,12 @@ const chai = require("chai")
88const assert = chai . assert
99
1010const 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.
1419const util = require ( "util" )
You can’t perform that action at this time.
0 commit comments