From 43523c842530ffef002cfa65eee97b149eeca476 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 13 Nov 2024 17:38:04 -0800 Subject: [PATCH] nocks --- .../client/__tests__/client-mock.test.ts | 3 ++- v2/packages/client/setup-jest.ts | 21 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/v1/packages/client/__tests__/client-mock.test.ts b/v1/packages/client/__tests__/client-mock.test.ts index a57390315..759317e2e 100644 --- a/v1/packages/client/__tests__/client-mock.test.ts +++ b/v1/packages/client/__tests__/client-mock.test.ts @@ -3,7 +3,8 @@ import nock from 'nock'; import { ChainRegistryClient } from '../src/registry'; import { assets, chains } from '../test-utils'; -const baseUrl = 'https://raw.githubusercontent.com'; +const baseUrl = 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/original'; + function nockByChainName(chainName: string) { const chainDataPath = `/cosmos/chain-registry/master/${chainName}/chain.json`; diff --git a/v2/packages/client/setup-jest.ts b/v2/packages/client/setup-jest.ts index a2d065315..d86dade8f 100644 --- a/v2/packages/client/setup-jest.ts +++ b/v2/packages/client/setup-jest.ts @@ -2,8 +2,7 @@ import nock from 'nock'; import { assetLists, chains, ibc } from './test-utils'; -const baseUrl = 'https://raw.githubusercontent.com'; - +const baseUrl = 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/full'; beforeAll(() => { // 'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/chain.json', @@ -13,35 +12,35 @@ beforeAll(() => { // 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/juno-osmosis.json', // 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/osmosis-secretnetwork.json' nock(baseUrl) - .get('/cosmos/chain-registry/master/osmosis/chain.json') + .get('/osmosis/chain.json') .reply(200, chains.find(c => c.chainName === 'osmosis')); nock(baseUrl) - .get('/cosmos/chain-registry/master/osmosis/assetlist.json') + .get('/osmosis/assetlist.json') .reply(200, assetLists.find(c => c.chainName === 'osmosis')); nock(baseUrl) - .get('/cosmos/chain-registry/master/stargaze/chain.json') + .get('/stargaze/chain.json') .reply(200, chains.find(c => c.chainName === 'stargaze')); nock(baseUrl) - .get('/cosmos/chain-registry/master/stargaze/assetlist.json') + .get('/stargaze/assetlist.json') .reply(200, assetLists.find(c => c.chainName === 'stargaze')); nock(baseUrl) - .get('/cosmos/chain-registry/master/juno/chain.json') + .get('/juno/chain.json') .reply(200, chains.find(c => c.chainName === 'juno')); nock(baseUrl) - .get('/cosmos/chain-registry/master/juno/assetlist.json') + .get('/juno/assetlist.json') .reply(200, assetLists.find(c => c.chainName === 'juno')); nock(baseUrl) - .get('/cosmos/chain-registry/master/secretnetwork/assetlist.json') + .get('/secretnetwork/assetlist.json') .reply(200, assetLists.find(c => c.chainName === 'secretnetwork')); nock(baseUrl) - .get('/cosmos/chain-registry/master/_IBC/juno-osmosis.json') + .get('/_IBC/juno-osmosis.json') .reply(200, ibc.find(i => i.chain1.chainName === 'juno' && i.chain2.chainName==='osmosis')); nock(baseUrl) - .get('/cosmos/chain-registry/master/_IBC/osmosis-secretnetwork.json') + .get('/_IBC/osmosis-secretnetwork.json') .reply(200, ibc.find(i => i.chain1.chainName === 'osmosis' && i.chain2.chainName==='secretnetwork')); });