fix(linting): Adding standard linting rules

This commit is contained in:
Chris Troutner
2021-01-02 15:41:12 -08:00
parent bdb4de0353
commit 3cedd251e5
102 changed files with 7280 additions and 5955 deletions
+12 -12
View File
@@ -7,49 +7,49 @@
- Update the PRO_PASS value with a current PRO_PASSES string used by bch-api.
*/
const assert = require("chai").assert
const assert = require('chai').assert
const PRO_PASS = "testpassword"
const PRO_PASS = 'testpassword'
const BCHJS = require("../../../src/bch-js")
const BCHJS = require('../../../src/bch-js')
const bchjs = new BCHJS({
// restURL: `https://bchn.fullstack.cash/v4/`,
restURL: `https://abc.fullstack.cash/v4/`,
restURL: 'https://abc.fullstack.cash/v4/',
// restURL: `http://localhost:3000/v4/`,
authPass: PRO_PASS
})
describe("#Basic Authentication rate limits", () => {
it("should allow more than 20 RPM to full node", async () => {
describe('#Basic Authentication rate limits', () => {
it('should allow more than 20 RPM to full node', async () => {
for (let i = 0; i < 22; i++) {
const result = await bchjs.Control.getNetworkInfo()
if (i === 5) {
// console.log(`validating 5th call: ${i}`)
assert.property(result, "version", "more than 3 calls allowed")
assert.property(result, 'version', 'more than 3 calls allowed')
}
if (i === 15) {
// console.log(`validating 5th call: ${i}`)
assert.property(result, "version", "more than 10 calls allowed")
assert.property(result, 'version', 'more than 10 calls allowed')
}
}
}).timeout(45000)
it("should allow more than 20 RPM to an indexer", async () => {
const addr = "bitcoincash:qrdka2205f4hyukutc2g0s6lykperc8nsu5u2ddpqf"
it('should allow more than 20 RPM to an indexer', async () => {
const addr = 'bitcoincash:qrdka2205f4hyukutc2g0s6lykperc8nsu5u2ddpqf'
for (let i = 0; i < 22; i++) {
const result = await bchjs.Blockbook.balance(addr)
if (i === 5) {
// console.log(`validating 5th call: ${i}`)
assert.property(result, "balance", "more than 3 calls allowed")
assert.property(result, 'balance', 'more than 3 calls allowed')
}
if (i === 15) {
// console.log(`validating 5th call: ${i}`)
assert.property(result, "balance", "more than 10 calls allowed")
assert.property(result, 'balance', 'more than 10 calls allowed')
}
}
}).timeout(45000)