solana/web3.js/test/testnet.test.js

27 lines
583 B
JavaScript
Raw Normal View History

2018-12-19 19:28:28 -08:00
// @flow
import {testnetChannelEndpoint} from '../src/util/testnet';
test('invalid', () => {
expect(() => {
testnetChannelEndpoint('abc123');
}).toThrow();
});
test('edge', () => {
expect(testnetChannelEndpoint('edge')).toEqual(
'https://edge.testnet.solana.com:8443',
2018-12-19 19:28:28 -08:00
);
2019-07-26 14:54:51 -07:00
expect(testnetChannelEndpoint('edge', true)).toEqual(
'https://edge.testnet.solana.com:8443',
);
expect(testnetChannelEndpoint('edge', false)).toEqual(
'http://edge.testnet.solana.com:8899',
);
2018-12-19 19:28:28 -08:00
});
test('default', () => {
testnetChannelEndpoint(); // Should not throw
});