2018-12-19 19:28:28 -08:00
|
|
|
// @flow
|
|
|
|
import {testnetChannelEndpoint} from '../src/util/testnet';
|
|
|
|
|
|
|
|
test('invalid', () => {
|
|
|
|
expect(() => {
|
|
|
|
testnetChannelEndpoint('abc123');
|
|
|
|
}).toThrow();
|
|
|
|
});
|
|
|
|
|
2020-03-10 21:13:31 -07:00
|
|
|
test('stable', () => {
|
2020-03-16 17:44:12 +08:00
|
|
|
expect(testnetChannelEndpoint('stable')).toEqual('https://devnet.solana.com');
|
2019-07-26 14:54:51 -07:00
|
|
|
|
2020-03-10 21:13:31 -07:00
|
|
|
expect(testnetChannelEndpoint('stable', true)).toEqual(
|
|
|
|
'https://devnet.solana.com',
|
2019-07-26 14:54:51 -07:00
|
|
|
);
|
|
|
|
|
2020-03-10 21:13:31 -07:00
|
|
|
expect(testnetChannelEndpoint('stable', false)).toEqual(
|
|
|
|
'http://devnet.solana.com',
|
2019-07-26 14:54:51 -07:00
|
|
|
);
|
2018-12-19 19:28:28 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
test('default', () => {
|
|
|
|
testnetChannelEndpoint(); // Should not throw
|
|
|
|
});
|