From 44c3bf44f95a68385cac5b3b34991534740e8e6e Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 9 Aug 2021 14:54:49 -0700 Subject: [PATCH] fix(getRawTransaction): Fixing integration test --- test/integration/blockchain.js | 2 +- test/integration/chains/abc/rawtransaction.js | 2 +- test/integration/chains/abc/slp.js | 2 +- test/integration/chains/abc/utxo-integration.js | 2 +- test/integration/chains/testnet/blockchain.js | 2 +- test/integration/chains/testnet/control.js | 2 +- test/integration/chains/testnet/electrumx.js | 2 +- test/integration/chains/testnet/ninsight.js | 2 +- test/integration/chains/testnet/rawtransaction.js | 2 +- test/integration/chains/testnet/slp.js | 2 +- test/integration/chains/testnet/util.js | 2 +- test/integration/control.js | 2 +- test/integration/electrumx.js | 2 +- test/integration/encryption.js | 2 +- test/integration/ninsight.js | 2 +- test/integration/price.js | 2 +- test/integration/rawtransaction.js | 5 ++--- test/integration/util.js | 2 +- 18 files changed, 19 insertions(+), 20 deletions(-) diff --git a/test/integration/blockchain.js b/test/integration/blockchain.js index 6b44b0e..0b90788 100644 --- a/test/integration/blockchain.js +++ b/test/integration/blockchain.js @@ -22,7 +22,7 @@ util.inspect.defaultOptions = { describe('#blockchain', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#getBestBlockHash', () => { diff --git a/test/integration/chains/abc/rawtransaction.js b/test/integration/chains/abc/rawtransaction.js index 5fde301..a1115df 100644 --- a/test/integration/chains/abc/rawtransaction.js +++ b/test/integration/chains/abc/rawtransaction.js @@ -20,7 +20,7 @@ util.inspect.defaultOptions = { describe('#rawtransaction', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) /* diff --git a/test/integration/chains/abc/slp.js b/test/integration/chains/abc/slp.js index 3ba0d46..e4a0e85 100644 --- a/test/integration/chains/abc/slp.js +++ b/test/integration/chains/abc/slp.js @@ -25,7 +25,7 @@ describe('#SLP', () => { beforeEach(async () => { // Introduce a delay so that the BVT doesn't trip the rate limits. - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) bchjs = new BCHJS({ restURL: process.env.RESTURL }) }) diff --git a/test/integration/chains/abc/utxo-integration.js b/test/integration/chains/abc/utxo-integration.js index 1fb5655..c5a2f97 100644 --- a/test/integration/chains/abc/utxo-integration.js +++ b/test/integration/chains/abc/utxo-integration.js @@ -11,7 +11,7 @@ describe('#UTXO', () => { beforeEach(async () => { // sandbox = sinon.createSandbox() - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#get', () => { diff --git a/test/integration/chains/testnet/blockchain.js b/test/integration/chains/testnet/blockchain.js index 7ea77a8..f76441a 100644 --- a/test/integration/chains/testnet/blockchain.js +++ b/test/integration/chains/testnet/blockchain.js @@ -29,7 +29,7 @@ util.inspect.defaultOptions = { describe('#blockchain', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#getBestBlockHash', () => { diff --git a/test/integration/chains/testnet/control.js b/test/integration/chains/testnet/control.js index 908beac..f7f1dd7 100644 --- a/test/integration/chains/testnet/control.js +++ b/test/integration/chains/testnet/control.js @@ -14,7 +14,7 @@ const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN }) describe('#control', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#getNetworkInfo', () => { diff --git a/test/integration/chains/testnet/electrumx.js b/test/integration/chains/testnet/electrumx.js index dd1369f..b4e8312 100644 --- a/test/integration/chains/testnet/electrumx.js +++ b/test/integration/chains/testnet/electrumx.js @@ -16,7 +16,7 @@ describe('#ElectrumX', () => { beforeEach(async () => { sandbox = sinon.createSandbox() - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) afterEach(() => sandbox.restore()) diff --git a/test/integration/chains/testnet/ninsight.js b/test/integration/chains/testnet/ninsight.js index efcabd2..b65b29a 100644 --- a/test/integration/chains/testnet/ninsight.js +++ b/test/integration/chains/testnet/ninsight.js @@ -9,7 +9,7 @@ describe('#Ninsight', () => { let sandbox beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) sandbox = sinon.createSandbox() }) diff --git a/test/integration/chains/testnet/rawtransaction.js b/test/integration/chains/testnet/rawtransaction.js index 6228e04..fb37a8d 100644 --- a/test/integration/chains/testnet/rawtransaction.js +++ b/test/integration/chains/testnet/rawtransaction.js @@ -27,7 +27,7 @@ util.inspect.defaultOptions = { describe('#rawtransaction', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#decodeRawTransaction', () => { diff --git a/test/integration/chains/testnet/slp.js b/test/integration/chains/testnet/slp.js index 29cc622..9e339ea 100644 --- a/test/integration/chains/testnet/slp.js +++ b/test/integration/chains/testnet/slp.js @@ -25,7 +25,7 @@ util.inspect.defaultOptions = { describe('#SLP', () => { beforeEach(async () => { // Introduce a delay so that the BVT doesn't trip the rate limits. - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#util', () => { diff --git a/test/integration/chains/testnet/util.js b/test/integration/chains/testnet/util.js index 0fa99a1..569e9a7 100644 --- a/test/integration/chains/testnet/util.js +++ b/test/integration/chains/testnet/util.js @@ -25,7 +25,7 @@ util.inspect.defaultOptions = { describe('#util', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#validateAddress', () => { diff --git a/test/integration/control.js b/test/integration/control.js index a99f320..bbae59f 100644 --- a/test/integration/control.js +++ b/test/integration/control.js @@ -9,7 +9,7 @@ const bchjs = new BCHJS() describe('#control', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#getNetworkInfo', () => { diff --git a/test/integration/electrumx.js b/test/integration/electrumx.js index aa322bb..bfeb163 100644 --- a/test/integration/electrumx.js +++ b/test/integration/electrumx.js @@ -11,7 +11,7 @@ describe('#ElectrumX', () => { beforeEach(async () => { sandbox = sinon.createSandbox() - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) afterEach(() => sandbox.restore()) diff --git a/test/integration/encryption.js b/test/integration/encryption.js index c7b932c..170d63c 100644 --- a/test/integration/encryption.js +++ b/test/integration/encryption.js @@ -5,7 +5,7 @@ const bchjs = new BCHJS() describe('#Encryption', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#getPubKey', () => { diff --git a/test/integration/ninsight.js b/test/integration/ninsight.js index 587938d..83f9dac 100644 --- a/test/integration/ninsight.js +++ b/test/integration/ninsight.js @@ -11,7 +11,7 @@ describe('#Ninsight', () => { beforeEach(async () => { sandbox = sinon.createSandbox() - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) afterEach(() => sandbox.restore()) diff --git a/test/integration/price.js b/test/integration/price.js index 2368e8c..17b4e85 100644 --- a/test/integration/price.js +++ b/test/integration/price.js @@ -4,7 +4,7 @@ const bchjs = new BCHJS() describe('#price', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#current', () => { diff --git a/test/integration/rawtransaction.js b/test/integration/rawtransaction.js index e75e51b..1ac6c84 100644 --- a/test/integration/rawtransaction.js +++ b/test/integration/rawtransaction.js @@ -19,7 +19,7 @@ util.inspect.defaultOptions = { describe('#rawtransaction', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#decodeRawTransaction', () => { @@ -191,8 +191,7 @@ describe('#rawtransaction', () => { console.log(`result: ${util.inspect(result)}`) assert.equal(true, false, 'Unexpected result!') } catch (err) { - assert.hasAnyKeys(err, ['error']) - assert.include(err.error, 'Array too large') + assert.include(err.message, 'Array too large') } }) }) diff --git a/test/integration/util.js b/test/integration/util.js index f1ce7f4..0dffce2 100644 --- a/test/integration/util.js +++ b/test/integration/util.js @@ -18,7 +18,7 @@ util.inspect.defaultOptions = { describe('#util', () => { beforeEach(async () => { - if (process.env.IS_USING_FREE_TIER) await sleep(1000) + if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) describe('#validateAddress', () => {