mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
* rename RippleAPI -> XrplClient * more renames * move API stuff to client folder * rename all api -> client * fix tests * make tests run * fix integ tests * fix urls * fix merge issues * XrplClient -> Client * fix merge issues * rename xrpl-client npm symlink to xrpl-local
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import assert from 'assert-diff'
|
|
|
|
import setupClient from './setup-client'
|
|
import {getFaucetUrl, FaucetNetwork} from '../src/wallet/wallet-generation'
|
|
|
|
describe('Get Faucet URL', function () {
|
|
beforeEach(setupClient.setup)
|
|
afterEach(setupClient.teardown)
|
|
|
|
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)
|
|
})
|
|
})
|