* feat: update api urls (cherry picked from commit0f3045fb68
) * fix: cluster test (cherry picked from commitae5a10dffd
) * docs: update old devnet and testnet url references (cherry picked from commitec621e71dc
) * fix: update devnet and testnet urls (cherry picked from commit7be3171f4a
) Co-authored-by: Josh Hundley <josh.hundley@gmail.com>
26 lines
620 B
JavaScript
26 lines
620 B
JavaScript
// @flow
|
|
|
|
import {expect} from 'chai';
|
|
|
|
import {clusterApiUrl} from '../src/util/cluster';
|
|
|
|
describe('Cluster Util', () => {
|
|
it('invalid', () => {
|
|
expect(() => {
|
|
// $FlowExpectedError
|
|
clusterApiUrl('abc123');
|
|
}).to.throw();
|
|
});
|
|
|
|
it('devnet', () => {
|
|
expect(clusterApiUrl()).to.eq('https://api.devnet.solana.com');
|
|
expect(clusterApiUrl('devnet')).to.eq('https://api.devnet.solana.com');
|
|
expect(clusterApiUrl('devnet', true)).to.eq(
|
|
'https://api.devnet.solana.com',
|
|
);
|
|
expect(clusterApiUrl('devnet', false)).to.eq(
|
|
'http://api.devnet.solana.com',
|
|
);
|
|
});
|
|
});
|