Files
xahau.js/test/client/errors.ts
Mayukha Vadari b522e703b4 feat: add client.getLedgerIndex (#1668)
* write getLedgerIndex

* add to client

* rename file

* add tests

* remove unused import

* fix browser tests

* respond to comments, more cleanup
2021-10-04 14:11:26 -04:00

20 lines
602 B
TypeScript

import { assert } from 'chai'
import { XrplError, NotFoundError } from '../../src'
import { setupClient, teardownClient } from '../setupClient'
describe('client errors', function () {
beforeEach(setupClient)
afterEach(teardownClient)
it('XrplError with data', async function () {
const error = new XrplError('_message_', '_data_')
assert.strictEqual(error.toString(), "[XrplError(_message_, '_data_')]")
})
it('NotFoundError default message', async function () {
const error = new NotFoundError()
assert.strictEqual(error.toString(), '[NotFoundError(Not found)]')
})
})