solana/web3.js/test/cluster.test.js

17 lines
497 B
JavaScript
Raw Normal View History

2020-03-30 05:27:09 -07:00
// @flow
import {clusterApiUrl} from '../src/util/cluster';
test('invalid', () => {
expect(() => {
2020-06-18 00:31:01 -07:00
// $FlowExpectedError
2020-03-30 05:27:09 -07:00
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');
});