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
This commit is contained in:
Mayukha Vadari
2021-09-24 18:40:03 -04:00
parent 0be819cf37
commit b522e703b4
9 changed files with 47 additions and 32 deletions

View File

@@ -1,5 +1,6 @@
import { assert } from 'chai'
import { XrplError, NotFoundError } from '../../src'
import { setupClient, teardownClient } from '../setupClient'
describe('client errors', function () {
@@ -7,12 +8,12 @@ describe('client errors', function () {
afterEach(teardownClient)
it('XrplError with data', async function () {
const error = new this.client.errors.XrplError('_message_', '_data_')
const error = new XrplError('_message_', '_data_')
assert.strictEqual(error.toString(), "[XrplError(_message_, '_data_')]")
})
it('NotFoundError default message', async function () {
const error = new this.client.errors.NotFoundError()
const error = new NotFoundError()
assert.strictEqual(error.toString(), '[NotFoundError(Not found)]')
})
})