| 
									
										
										
										
											2020-03-30 20:27:09 +08:00
										 |  |  | // @flow
 | 
					
						
							|  |  |  | import {clusterApiUrl} from '../src/util/cluster'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | test('invalid', () => { | 
					
						
							|  |  |  |   expect(() => { | 
					
						
							| 
									
										
										
										
											2020-06-18 15:31:01 +08:00
										 |  |  |     // $FlowExpectedError
 | 
					
						
							| 
									
										
										
										
											2020-03-30 20:27:09 +08:00
										 |  |  |     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'); | 
					
						
							|  |  |  | }); |