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