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

19 lines
547 B
TypeScript
Raw Normal View History

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(() => {
2021-03-14 22:08:10 -07:00
clusterApiUrl('abc123' as any);
2021-02-05 18:59:00 -08:00
}).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
});