mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Lints top-level test files (#1594)
* lint broadcastClient * lint client * fix most of connection * remove unused files * lint mockRippled * lint mockRippledTest * lint runClientTests * lint setupClient * lint setupClientWeb * lint shamap * lint testUtils * resolve tsc issues * Fix tests * lint rest of connection * respond to comments
This commit is contained in:
@@ -2,12 +2,12 @@ import { assert } from 'chai'
|
||||
|
||||
import { RippledError } from '../src/common/errors'
|
||||
|
||||
import setupClient from './setupClient'
|
||||
import { setupClient, teardownClient } from './setupClient'
|
||||
import { assertRejects } from './testUtils'
|
||||
|
||||
describe('mock rippled tests', function () {
|
||||
beforeEach(setupClient.setup)
|
||||
afterEach(setupClient.teardown)
|
||||
beforeEach(setupClient)
|
||||
afterEach(teardownClient)
|
||||
it('errors if a mock is not provided', async function () {
|
||||
this.mockRippled.suppressOutput = true
|
||||
await assertRejects(
|
||||
@@ -17,10 +17,14 @@ describe('mock rippled tests', function () {
|
||||
})
|
||||
|
||||
it('provide bad response shape', async function () {
|
||||
assert.throws(
|
||||
() => this.mockRippled.addResponse('account_info', { data: {} }),
|
||||
Error,
|
||||
)
|
||||
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 () {
|
||||
|
||||
Reference in New Issue
Block a user