mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
POST, isArray check, 100% test
This commit is contained in:
@@ -143,11 +143,13 @@ describe(`#Ninsight`, () => {
|
||||
}
|
||||
})
|
||||
|
||||
it(`should GET details for a single address`, async () => {
|
||||
it(`should POST address details for a single address`, async () => {
|
||||
const addr = "bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7"
|
||||
|
||||
const result = await bchjs.Ninsight.details(addr)
|
||||
//console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
||||
|
||||
assert.isArray(result)
|
||||
assert.property(result[0], "balance")
|
||||
assert.property(result[0], "balanceSat")
|
||||
assert.property(result[0], "totalReceived")
|
||||
@@ -166,7 +168,7 @@ describe(`#Ninsight`, () => {
|
||||
assert.property(result[0], "pagesTotal")
|
||||
})
|
||||
|
||||
it(`should GET details for an array of addresses`, async () => {
|
||||
it(`should POST address details for an array of addresses`, async () => {
|
||||
const addr = [
|
||||
"bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7",
|
||||
"bitcoincash:qz0us0z6ucpqt07jgpad0shgh7xmwxyr3ynlcsq0wr"
|
||||
|
||||
@@ -149,11 +149,12 @@ describe(`#Ninsight`, () => {
|
||||
}
|
||||
})
|
||||
|
||||
it(`should GET details for a single address`, async () => {
|
||||
it(`should POST address details for a single address`, async () => {
|
||||
const addr = "bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7"
|
||||
|
||||
const result = await bchjs.Ninsight.details(addr)
|
||||
//console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
||||
assert.isArray(result)
|
||||
assert.property(result[0], "balance")
|
||||
assert.property(result[0], "balanceSat")
|
||||
assert.property(result[0], "totalReceived")
|
||||
@@ -172,7 +173,7 @@ describe(`#Ninsight`, () => {
|
||||
assert.property(result[0], "pagesTotal")
|
||||
})
|
||||
|
||||
it(`should GET details for an array of addresses`, async () => {
|
||||
it(`should POST address details for an array of addresses`, async () => {
|
||||
const addr = [
|
||||
"bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7",
|
||||
"bitcoincash:qz0us0z6ucpqt07jgpad0shgh7xmwxyr3ynlcsq0wr"
|
||||
|
||||
@@ -158,11 +158,12 @@ describe(`#Ninsight`, () => {
|
||||
}
|
||||
})
|
||||
|
||||
it(`should GET details for a single address`, async () => {
|
||||
it(`should POST address details for a single address`, async () => {
|
||||
const addr = "bchtest:qzjtnzcvzxx7s0na88yrg3zl28wwvfp97538sgrrmr"
|
||||
|
||||
const result = await bchjs.Ninsight.details(addr)
|
||||
//console.log(`result: ${JSON.stringify(result, null, 2)}`)
|
||||
assert.isArray(result)
|
||||
assert.property(result[0], "balance")
|
||||
assert.property(result[0], "balanceSat")
|
||||
assert.property(result[0], "totalReceived")
|
||||
@@ -181,7 +182,7 @@ describe(`#Ninsight`, () => {
|
||||
assert.property(result[0], "pagesTotal")
|
||||
})
|
||||
|
||||
it(`should GET details for an array of addresses`, async () => {
|
||||
it(`should POST address details for an array of addresses`, async () => {
|
||||
const addr = [
|
||||
"bchtest:qzjtnzcvzxx7s0na88yrg3zl28wwvfp97538sgrrmr",
|
||||
"bchtest:qp6hgvevf4gzz6l7pgcte3gaaud9km0l459fa23dul"
|
||||
|
||||
@@ -312,6 +312,10 @@ describe(`#Ninsight`, () => {
|
||||
assert.property(result, "pagesTotal")
|
||||
})
|
||||
|
||||
it(`should call constructor with null args`, async () => {
|
||||
new bchjs.Ninsight.constructor({})
|
||||
})
|
||||
|
||||
it(`should GET details for an array of addresses`, async () => {
|
||||
// Mock the network call.
|
||||
sandbox.stub(axios, "post").resolves({
|
||||
|
||||
Reference in New Issue
Block a user