hopefully fix websockets closing from over-use
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Wallet } from "../src/util/types";
|
||||
import { readFileSync } from 'fs'
|
||||
const Path = require('path')
|
||||
|
||||
export const TEST_CONFIG = {
|
||||
"rippleNode": "wss://s.altnet.rippletest.net:51233"
|
||||
@@ -22,6 +24,8 @@ export const makeTestnetWallet = () : Promise<Wallet> => fetch('https://faucet.a
|
||||
})
|
||||
});
|
||||
|
||||
export const htmlTxt = readFileSync(Path.resolve(__dirname, '..', '..', 'test', 'index.html')).toString('ascii')
|
||||
|
||||
export const longText = `Software testing
|
||||
From Wikipedia, the free encyclopedia
|
||||
Jump to navigationJump to search
|
||||
|
||||
File diff suppressed because one or more lines are too long
+16
-5
@@ -1,5 +1,5 @@
|
||||
import { RippleAPI } from 'ripple-lib'
|
||||
import { longText, makeTestnetWallet, TEST_CONFIG, TEST_DATA } from './CONSTANTS'
|
||||
import { htmlTxt, longText, makeTestnetWallet, TEST_CONFIG, TEST_DATA } from './CONSTANTS'
|
||||
import { getLatestSequence, sendPayment, treeRead, treeWrite } from '../src/xrpIO/ripple-binding'
|
||||
import * as chai from 'chai';
|
||||
import { Wallet } from '../src/util/types';
|
||||
@@ -19,7 +19,7 @@ describe('XRPIO', () => {
|
||||
await new Promise((res, rej) => setTimeout(res, 10000)) //it takes a moment for the wallets to become active
|
||||
})
|
||||
|
||||
before(async () => {
|
||||
beforeEach(async () => {
|
||||
try {
|
||||
api = new RippleAPI({ server: TEST_CONFIG.rippleNode })
|
||||
return await api.connect()
|
||||
@@ -29,7 +29,7 @@ describe('XRPIO', () => {
|
||||
}
|
||||
})
|
||||
|
||||
after(async function () {
|
||||
afterEach(async function () {
|
||||
try {
|
||||
return await api.disconnect()
|
||||
} catch (e) {
|
||||
@@ -64,7 +64,7 @@ describe('XRPIO', () => {
|
||||
})
|
||||
|
||||
it('can tree read', async function () {
|
||||
this.timeout(1500)
|
||||
this.timeout(15000)
|
||||
const data = await treeRead(api, [treeRoot])
|
||||
expect(data).to.be.equal(TEST_DATA)
|
||||
})
|
||||
@@ -75,11 +75,22 @@ describe('XRPIO', () => {
|
||||
})
|
||||
|
||||
it('can tree read large', async function () {
|
||||
this.timeout(3000)
|
||||
this.timeout(30000)
|
||||
const data = await treeRead(api, [treeRoot])
|
||||
expect(data).to.be.equal(longText)
|
||||
})
|
||||
|
||||
it(`can tree write extra large (${htmlTxt.length} bytes)`, async function () {
|
||||
this.timeout(300000)
|
||||
treeRoot = await treeWrite(api, htmlTxt, sendWallet, receiveWallet.address)
|
||||
})
|
||||
|
||||
it('can tree read extra large', async function () {
|
||||
this.timeout(300000)
|
||||
const data = await treeRead(api, [treeRoot])
|
||||
expect(data).to.be.equal(htmlTxt)
|
||||
})
|
||||
|
||||
it("can r/w binary", async function () {
|
||||
this.timeout(10000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user