feat: rename testnet util methods
This commit is contained in:
committed by
Michael Vines
parent
352f296c09
commit
aeedd3867f
16
web3.js/test/cluster.test.js
Normal file
16
web3.js/test/cluster.test.js
Normal file
@ -0,0 +1,16 @@
|
||||
// @flow
|
||||
import {clusterApiUrl} from '../src/util/cluster';
|
||||
|
||||
test('invalid', () => {
|
||||
expect(() => {
|
||||
// $FlowIgnore
|
||||
clusterApiUrl('abc123');
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
test('devnet', () => {
|
||||
expect(clusterApiUrl()).toEqual('https://devnet.solana.com');
|
||||
expect(clusterApiUrl('devnet')).toEqual('https://devnet.solana.com');
|
||||
expect(clusterApiUrl('devnet', true)).toEqual('https://devnet.solana.com');
|
||||
expect(clusterApiUrl('devnet', false)).toEqual('http://devnet.solana.com');
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
// @flow
|
||||
import {testnetChannelEndpoint} from '../src/util/testnet';
|
||||
|
||||
test('invalid', () => {
|
||||
expect(() => {
|
||||
testnetChannelEndpoint('abc123');
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
test('stable', () => {
|
||||
expect(testnetChannelEndpoint('stable')).toEqual('https://devnet.solana.com');
|
||||
|
||||
expect(testnetChannelEndpoint('stable', true)).toEqual(
|
||||
'https://devnet.solana.com',
|
||||
);
|
||||
|
||||
expect(testnetChannelEndpoint('stable', false)).toEqual(
|
||||
'http://devnet.solana.com',
|
||||
);
|
||||
});
|
||||
|
||||
test('default', () => {
|
||||
testnetChannelEndpoint(); // Should not throw
|
||||
});
|
Reference in New Issue
Block a user