Files
xahau.js/test/integration/requests/utility.ts
Mayukha Vadari 0674d21134 fix: remove response.status from returned object (#1698)
* remove response.status

* fix unit tests

* fix integration tests

* remove now-unneeded helper method

* fix rename
2021-10-06 18:13:27 -04:00

46 lines
1.1 KiB
TypeScript

import { assert } from 'chai'
import _ from 'lodash'
import { Client } from 'xrpl-local'
import serverUrl from '../serverUrl'
import { setupClient, suiteClientSetup, teardownClient } from '../setup'
// how long before each test case times out
const TIMEOUT = 20000
describe('Utility method integration tests', function () {
this.timeout(TIMEOUT)
before(suiteClientSetup)
beforeEach(_.partial(setupClient, serverUrl))
afterEach(teardownClient)
it('ping', async function () {
const response = await (this.client as Client).request({
command: 'ping',
})
const expected = {
id: 0,
result: { role: 'admin', unlimited: true },
type: 'response',
}
assert.deepEqual(_.omit(response, 'id'), _.omit(expected, 'id'))
})
it('random', async function () {
const response = await (this.client as Client).request({
command: 'random',
})
const expected = {
id: 0,
result: {
random: '[random string of 64 bytes]',
},
type: 'response',
}
assert.equal(response.type, expected.type)
assert.equal(response.result.random.length, 64)
})
})