diff --git a/package.json b/package.json index b6a8916..90af705 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test:integration:temp:bchn": "export RESTURL=http://157.90.174.219:3000/v5/ && mocha --timeout 30000 test/integration/", "test:temp": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 -g '#Encryption' test/integration/", "test:temp2": "mocha --timeout=30000 -g '#TransactionLib' test/unit/", - "test:temp3": "export RESTURL=https://bchn.fullstack.cash/v5/ && mocha --timeout 30000 -g '#Transaction' test/integration/", + "test:temp3": "export RESTURL=https://bchn.fullstack.cash/v5/ && mocha --timeout 30000 -g '#DSProof' test/integration/chains/", "test:temp4": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 -g '#decodeOpReturn' test/integration/", "coverage": "nyc report --reporter=text-lcov | coveralls", "coverage:report": "nyc --reporter=html mocha --timeout 25000 test/unit/", diff --git a/src/util.js b/src/util.js index 51dfc4c..27d817c 100644 --- a/src/util.js +++ b/src/util.js @@ -28,7 +28,7 @@ class Util { } /** - * @api util.floor8() floor8() + * @api Util.floor8() floor8() * @apiName floor8 * @apiGroup Util * @apiDescription Round a number down to 8 decimal places. @@ -63,7 +63,7 @@ class Util { } /** - * @api util.floor2() floor2() + * @api Util.floor2() floor2() * @apiName floor2 * @apiGroup Util * @apiDescription Round a number down to 2 decimal places. @@ -98,7 +98,7 @@ class Util { } /** - * @api util.chunk20() chunk20() + * @api Util.chunk20() chunk20() * @apiName chunk20 * @apiGroup Util * @apiDescription chunk up an array into multiple arrays of 20 elements each. @@ -151,7 +151,7 @@ class Util { } /** - * @api util.sleep() sleep() + * @api Util.sleep() sleep() * @apiName sleep * @apiGroup Util * @apiDescription Promise-based delay. @@ -175,7 +175,7 @@ class Util { } /** - * @api util.validateAddress() validateAddress() + * @api Util.validateAddress() validateAddress() * @apiName Validate Address. * @apiGroup Util * @apiDescription Return information about the given bitcoin address. diff --git a/test/integration/dsproof.js b/test/integration/chains/bchn/dsproof.js similarity index 63% rename from test/integration/dsproof.js rename to test/integration/chains/bchn/dsproof.js index 2c91b65..3eda3d0 100644 --- a/test/integration/dsproof.js +++ b/test/integration/chains/bchn/dsproof.js @@ -2,16 +2,16 @@ Integration tests for bchjs dsproof library. */ -const BCHJS = require('../../src/bch-js') +const BCHJS = require('../../../../src/bch-js') const bchjs = new BCHJS() describe('#DSProof', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await bchjs.Util.sleep(1000) }) describe('#getDSProof', () => { - it('should get info on the full node', async () => { + it('should get TX info from the full node', async () => { const txid = 'ee0df780b58f6f24467605b2589c44c3a50fc849fb8f91b89669a4ae0d86bc7e' const result = await bchjs.DSProof.getDSProof(txid) @@ -19,7 +19,3 @@ describe('#DSProof', () => { }) }) }) - -function sleep (ms) { - return new Promise(resolve => setTimeout(resolve, ms)) -}