fix(integration): Adding integration test script to package.json

This commit is contained in:
Chris Troutner
2022-01-24 13:21:29 -08:00
parent e5f6f24570
commit 7e7e91460a
3 changed files with 38 additions and 2 deletions
+1
View File
@@ -9,6 +9,7 @@
"test:all": "export SVC_ENV=test && nyc --reporter=text mocha --exit --timeout 15000 --recursive test/unit test/e2e/automated/",
"test:unit": "export SVC_ENV=test && mocha --exit --timeout 15000 --recursive test/unit/",
"test:e2e:auto": "export SVC_ENV=test && mocha --exit --timeout 30000 test/e2e/automated/",
"test:integration": "export SVC_ENV=test && mocha --timeout 30000 --recursive test/integration/",
"test:temp": "export SVC_ENV=test && mocha --exit --timeout 15000 -g '#rate-limit' test/unit/json-rpc/",
"lint": "standard --env mocha --fix",
"docs": "./node_modules/.bin/apidoc -i src/ -o docs",
+4 -2
View File
@@ -47,8 +47,10 @@ class Adapters {
this.bchjs = new BCHJS({ restURL: this.config.apiServer })
}
// Start the IPFS node.
await this.ipfs.start({ bchjs: this.bchjs })
if (this.config.env !== 'test') {
// Start the IPFS node.
await this.ipfs.start({ bchjs: this.bchjs })
}
} catch (err) {
console.error('Error in adapters/index.js/start()')
throw err
@@ -0,0 +1,33 @@
/*
Integration tests for the BCH Use Cases library
*/
// Local libraries
const BCHUseCases = require('../../../../src/use-cases/bch')
const Adapters = require('../../../../src/adapters')
describe('#BCH', () => {
let uut
before(async () => {
const adapters = new Adapters()
await adapters.start()
uut = new BCHUseCases({ adapters })
})
describe('#getTransactions', () => {
it('should get transactions for an address', async () => {
const rpcData = {
payload: {
params: {
addresses: ['bitcoincash:thing']
}
}
}
const result = await uut.getTransactions(rpcData)
console.log('result: ', result)
})
})
})