Files
solana/web3.js/test/cluster.test.js
mergify[bot] e41460d500 feat: update api urls (backport #17186) (#17248)
* feat: update api urls

(cherry picked from commit 0f3045fb68)

* fix: cluster test

(cherry picked from commit ae5a10dffd)

* docs: update old devnet and testnet url references

(cherry picked from commit ec621e71dc)

* fix: update devnet and testnet urls

(cherry picked from commit 7be3171f4a)

Co-authored-by: Josh Hundley <josh.hundley@gmail.com>
2021-05-15 00:08:24 +00:00

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',
);
});
});