chore: rename test files (#2181)

This commit is contained in:
justinr1234
2023-01-06 14:04:36 -06:00
committed by GitHub
parent 9e74f94c44
commit 8abcfe4640
122 changed files with 49 additions and 50 deletions

View File

@@ -0,0 +1,39 @@
import { assert } from 'chai'
import { RippledError } from 'xrpl-local'
import { setupClient, teardownClient } from './setupClient'
import { assertRejects } from './testUtils'
describe('mock rippled tests', function () {
beforeEach(setupClient)
afterEach(teardownClient)
it('errors if a mock is not provided', async function () {
this.mockRippled.suppressOutput = true
await assertRejects(
this.client.request({ command: 'server_info' }),
RippledError,
)
})
it('provide bad response shape', async function () {
try {
this.mockRippled.addResponse('account_info', { data: {} })
assert.fail('Should have errored')
} catch (err) {
if (!(err instanceof Error)) {
assert.fail(`Wrong error type: ${err as string}`)
}
}
})
it('provide bad response shape in function', async function () {
this.mockRippled.suppressOutput = true
this.mockRippled.addResponse('account_info', (request) => {
return { data: request }
})
await assertRejects(
this.client.request({ command: 'account_info', account: '' }),
RippledError,
)
})
})