chore: replace jest with mocha

This commit is contained in:
Justin Starry
2021-02-06 10:59:00 +08:00
committed by Justin Starry
parent 612958ece0
commit c675c67c26
41 changed files with 4635 additions and 6665 deletions

View File

@ -1,16 +1,19 @@
// @flow
import {clusterApiUrl} from '../src/util/cluster';
import {expect} from 'chai';
test('invalid', () => {
expect(() => {
// $FlowExpectedError
clusterApiUrl('abc123');
}).toThrow();
});
describe('Cluster Util', () => {
it('invalid', () => {
expect(() => {
// $FlowExpectedError
clusterApiUrl('abc123');
}).to.throw();
});
test('devnet', () => {
expect(clusterApiUrl()).toEqual('https://devnet.solana.com');
expect(clusterApiUrl('devnet')).toEqual('https://devnet.solana.com');
expect(clusterApiUrl('devnet', true)).toEqual('https://devnet.solana.com');
expect(clusterApiUrl('devnet', false)).toEqual('http://devnet.solana.com');
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');
});
});