feat: rename testnet util methods

This commit is contained in:
Justin Starry
2020-03-30 20:27:09 +08:00
committed by Michael Vines
parent 352f296c09
commit aeedd3867f
8 changed files with 65 additions and 73 deletions

View 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');
});

View File

@ -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
});