Working on unit tests

This commit is contained in:
Chris Troutner
2022-01-28 06:55:50 -08:00
parent 41a5071467
commit 27a9e9f3f3
3 changed files with 10 additions and 5 deletions
+4 -4
View File
@@ -38,7 +38,7 @@ class BCHUseCases {
// Get the transaction history for the list of addresses.
const data = await this.bchjs.Electrumx.transactions([addr])
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
console.log(`data: ${JSON.stringify(data, null, 2)}`)
if (!data.success) {
throw new Error('Could not query Fulcrum indexer.')
@@ -54,9 +54,9 @@ class BCHUseCases {
// Paginate the results
const pagedResults = this.bchjs.Util.chunk100(txsArr)
// console.log(
// `pagedResults[page]: ${JSON.stringify(pagedResults[page], null, 2)}`
// )
console.log(
`pagedResults[page]: ${JSON.stringify(pagedResults[page], null, 2)}`
)
const retObj = {
address: addr,
@@ -0,0 +1,3 @@
/*
Mock data for use-cases/bch/index.js unit tests
*/
@@ -42,7 +42,9 @@ describe('#bch-use-case', () => {
const rpcData = {
payload: {
params: {
addresses: ['bitcoincash:thing']
addresses: [
'bitcoincash:qpdh9s677ya8tnx7zdhfrn8qfyvy22wj4qa7nwqa5v'
]
}
}
}