Files
xahau.js/test/client/errors.ts
Nathan Nichols 615504db22 docs: finalizes documentation for xrpl.js (#1703)
docs: Adds JSDoc comments to all functions and interfaces
2021-10-12 14:04:18 -05:00

21 lines
604 B
TypeScript

import { assert } from 'chai'
import { XrplError, NotFoundError } from 'xrpl-local'
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)]')
})
})