mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
Add integration tests for ledger, ledgerEntry, ledgerData, ledgerClosed and ledgerCurrent, plus add them to the browser tests.
32 lines
797 B
TypeScript
32 lines
797 B
TypeScript
import { assert } from 'chai'
|
|
import _ from 'lodash'
|
|
|
|
import { LedgerRequest } from 'xrpl-local'
|
|
|
|
import serverUrl from '../serverUrl'
|
|
import { setupClient, suiteClientSetup, teardownClient } from '../setup'
|
|
import { verifySuccessfulResponse } from '../utils'
|
|
|
|
// how long before each test case times out
|
|
const TIMEOUT = 20000
|
|
|
|
describe('ledger', function () {
|
|
this.timeout(TIMEOUT)
|
|
|
|
before(suiteClientSetup)
|
|
beforeEach(_.partial(setupClient, serverUrl))
|
|
afterEach(teardownClient)
|
|
|
|
it('base', async function () {
|
|
const ledgerRequest: LedgerRequest = {
|
|
command: 'ledger',
|
|
ledger_index: 'validated',
|
|
}
|
|
|
|
const ledgerResponse = await this.client.request(ledgerRequest)
|
|
|
|
verifySuccessfulResponse(ledgerResponse)
|
|
assert(ledgerResponse.result.validated)
|
|
})
|
|
})
|