1- import { getChainsConfig , getChainConfig } from '../src'
1+ import { getChainsConfig , getChainConfig , setBaseUrl } from '../src'
22import config from './config'
33
44const mainnetChainId = '1'
55const rinkebyChainId = '4'
66const polygonChainId = '137'
77
88describe ( 'getChainsConfig & getChainConfig tests' , ( ) => {
9+ beforeAll ( ( ) => {
10+ setBaseUrl ( config . baseUrl )
11+ } )
12+
913 describe ( 'getChainsConfig tests' , ( ) => {
1014 it ( 'Returns all chains config' , async ( ) => {
11- const chainConfig = await getChainsConfig ( config . baseUrl )
15+ const chainConfig = await getChainsConfig ( )
1216
1317 expect ( chainConfig . results ) . toBe
1418 expect ( chainConfig . results ) . toBeDefined ( )
@@ -29,7 +33,7 @@ describe('getChainsConfig & getChainConfig tests', () => {
2933
3034 describe ( 'getChainConfig/{chainId} tests' , ( ) => {
3135 it ( 'Returns Mainnet config' , async ( ) => {
32- const mainnetConfig = await getChainConfig ( config . baseUrl , mainnetChainId )
36+ const mainnetConfig = await getChainConfig ( mainnetChainId )
3337
3438 expect ( mainnetConfig ) . toBeDefined ( )
3539 expect ( mainnetConfig . chainId ) . toBe ( mainnetChainId )
@@ -52,7 +56,7 @@ describe('getChainsConfig & getChainConfig tests', () => {
5256 } )
5357
5458 it ( 'Returns Rinkeby config' , async ( ) => {
55- const rinkebyConfig = await getChainConfig ( config . baseUrl , rinkebyChainId )
59+ const rinkebyConfig = await getChainConfig ( rinkebyChainId )
5660
5761 expect ( rinkebyConfig ) . toBeDefined ( )
5862 expect ( rinkebyConfig . chainId ) . toBe ( rinkebyChainId )
@@ -70,7 +74,7 @@ describe('getChainsConfig & getChainConfig tests', () => {
7074 } )
7175
7276 it ( 'Returns Polygon config' , async ( ) => {
73- const polygonConfig = await getChainConfig ( config . baseUrl , polygonChainId )
77+ const polygonConfig = await getChainConfig ( polygonChainId )
7478
7579 expect ( polygonConfig ) . toBeDefined ( )
7680 expect ( polygonConfig . chainId ) . toBe ( polygonChainId )
0 commit comments