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

22 lines
578 B
JavaScript
Raw Normal View History

2020-03-30 05:27:09 -07:00
// @flow
2021-02-07 08:57:12 -08:00
2021-02-05 18:59:00 -08:00
import {expect} from 'chai';
2020-03-30 05:27:09 -07:00
2021-02-07 08:57:12 -08:00
import {clusterApiUrl} from '../src/util/cluster';
2021-02-05 18:59:00 -08:00
describe('Cluster Util', () => {
it('invalid', () => {
expect(() => {
// $FlowExpectedError
clusterApiUrl('abc123');
}).to.throw();
});
2020-03-30 05:27:09 -07:00
2021-02-05 18:59:00 -08:00
it('devnet', () => {
expect(clusterApiUrl()).to.eq('https://devnet.solana.com');
expect(clusterApiUrl('devnet')).to.eq('https://devnet.solana.com');
expect(clusterApiUrl('devnet', true)).to.eq('https://devnet.solana.com');
expect(clusterApiUrl('devnet', false)).to.eq('http://devnet.solana.com');
});
2020-03-30 05:27:09 -07:00
});