mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
refactor: rename all test files to camelCase (#1562)
* rename files to camelCase * fix imports * more renames * pull all client tests out of individual folders * fix imports * fix tests
This commit is contained in:
35
test/walletGeneration.ts
Normal file
35
test/walletGeneration.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import assert from 'assert-diff'
|
||||
|
||||
import setupClient from './setupClient'
|
||||
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)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user