17 lines
		
	
	
		
			497 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			497 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// @flow
 | 
						|
import {clusterApiUrl} from '../src/util/cluster';
 | 
						|
 | 
						|
test('invalid', () => {
 | 
						|
  expect(() => {
 | 
						|
    // $FlowExpectedError
 | 
						|
    clusterApiUrl('abc123');
 | 
						|
  }).toThrow();
 | 
						|
});
 | 
						|
 | 
						|
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');
 | 
						|
});
 |