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

27 lines
558 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();
});
2020-03-10 21:13:31 -07:00
test('stable', () => {
expect(testnetChannelEndpoint('stable')).toEqual(
'https://devnet.solana.com',
2018-12-19 19:28:28 -08:00
);
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
});