Files
xahau.js/test/walletGeneration.ts
Mayukha Vadari 949cc031ee 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
2021-10-04 14:10:12 -04:00

37 lines
1.2 KiB
TypeScript

import { assert } from 'chai'
import { getFaucetUrl, FaucetNetwork } from '../src/wallet/generateFaucetWallet'
import { setupClient, teardownClient } from './setupClient'
describe('Get Faucet URL', function () {
beforeEach(setupClient)
afterEach(teardownClient)
it('returns the Devnet URL', function () {
const expectedFaucet = FaucetNetwork.Devnet
this.client.connection.url = FaucetNetwork.Devnet
assert.strictEqual(getFaucetUrl(this.client), expectedFaucet)
})
it('returns the Testnet URL', function () {
const expectedFaucet = FaucetNetwork.Testnet
this.client.connection.url = FaucetNetwork.Testnet
assert.strictEqual(getFaucetUrl(this.client), expectedFaucet)
})
it('returns the Testnet URL with the XRPL Labs server', function () {
const expectedFaucet = FaucetNetwork.Testnet
this.client.connection.url = 'wss://testnet.xrpl-labs.com'
assert.strictEqual(getFaucetUrl(this.client), expectedFaucet)
})
it('returns undefined if not a Testnet or Devnet server URL', function () {
// Info: setupClient.setup creates a connection to 'localhost'
assert.strictEqual(getFaucetUrl(this.client), undefined)
})
})