mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
* generate faucet wallet * updated comments * added example in documentation * updated documentation * Added xprl.org link in docs * updated code snippet * Made changes from comments * new changes from comments * yarn.lock * removed axios and use https.request * updated webpack to include http and https fallback * fixed files formatting * small fixes * Fix typo for Testnet Co-authored-by: Elliot Lee <github.public@intelliot.com> Co-authored-by: Elliot Lee <github.public@intelliot.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import assert from 'assert-diff'
|
|
|
|
import setupAPI from './setup-api'
|
|
import {getFaucetUrl, FaucetNetwork} from '../src/wallet/wallet-generation'
|
|
|
|
describe('Get Faucet URL', function () {
|
|
beforeEach(setupAPI.setup)
|
|
afterEach(setupAPI.teardown)
|
|
|
|
it('returns the Devnet URL', function () {
|
|
const expectedFaucet = FaucetNetwork.Devnet
|
|
this.api.connection._url = FaucetNetwork.Devnet
|
|
|
|
assert.strictEqual(getFaucetUrl(this.api), expectedFaucet)
|
|
})
|
|
|
|
it('returns the Testnet URL', function () {
|
|
const expectedFaucet = FaucetNetwork.Testnet
|
|
this.api.connection._url = FaucetNetwork.Testnet
|
|
|
|
assert.strictEqual(getFaucetUrl(this.api), expectedFaucet)
|
|
})
|
|
|
|
it('returns the Testnet URL with the XRPL Labs server', function () {
|
|
const expectedFaucet = FaucetNetwork.Testnet
|
|
this.api.connection._url = 'wss://testnet.xrpl-labs.com'
|
|
|
|
assert.strictEqual(getFaucetUrl(this.api), expectedFaucet)
|
|
})
|
|
|
|
it('returns undefined if not a Testnet or Devnet server URL', function () {
|
|
// Info: setupAPI.setup creates a connection to 'localhost'
|
|
assert.strictEqual(getFaucetUrl(this.api), undefined)
|
|
})
|
|
})
|