Skip to content

Commit 249d8ac

Browse files
committed
fix(e2e): rpc override test
1 parent 18cc2c2 commit 249d8ac

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

e2e/src/e2e.spec.ts

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,16 @@ describe('all', () => {
171171
});
172172

173173
describe('rpc override', () => {
174-
const ORIGINAL_RPC = process.env.LIT_YELLOWSTONE_PRIVATE_RPC_URL;
175-
const TEST_RPC = 'https://yellowstone-override.example';
174+
const TEST_RPC = process.env.LIT_YELLOWSTONE_PRIVATE_RPC_URL;
175+
// const TEST_RPC = 'https://yellowstone-override.example';
176176

177-
beforeAll(() => {
178-
process.env.LIT_YELLOWSTONE_PRIVATE_RPC_URL = TEST_RPC;
179-
});
177+
// beforeAll(() => {
178+
// process.env.LIT_YELLOWSTONE_PRIVATE_RPC_URL = TEST_RPC;
179+
// });
180180

181-
afterAll(() => {
182-
process.env.LIT_YELLOWSTONE_PRIVATE_RPC_URL = ORIGINAL_RPC;
183-
});
181+
// afterAll(() => {
182+
// process.env.LIT_YELLOWSTONE_PRIVATE_RPC_URL = ORIGINAL_RPC;
183+
// });
184184

185185
it('applies env rpc override to module and client', async () => {
186186
const networks = await import('@lit-protocol/networks');
@@ -205,16 +205,25 @@ describe('rpc override', () => {
205205
// log for verification
206206
// base vs effective (when override is supported)
207207
const baseRpcUrl =
208-
typeof baseModule.getRpcUrl === 'function' ? baseModule.getRpcUrl() : 'n/a';
208+
typeof baseModule.getRpcUrl === 'function'
209+
? baseModule.getRpcUrl()
210+
: 'n/a';
209211
const effRpcUrl =
210212
typeof mod.getRpcUrl === 'function' ? mod.getRpcUrl() : 'n/a';
211213
// eslint-disable-next-line no-console
212214
console.log('[rpc-override] TEST_RPC:', TEST_RPC);
213215
// eslint-disable-next-line no-console
214-
console.log('[rpc-override] module rpc (base → effective):', baseRpcUrl, '→', effRpcUrl);
216+
console.log(
217+
'[rpc-override] module rpc (base → effective):',
218+
baseRpcUrl,
219+
'→',
220+
effRpcUrl
221+
);
215222
try {
216223
const baseChain =
217-
typeof baseModule.getChainConfig === 'function' ? baseModule.getChainConfig() : null;
224+
typeof baseModule.getChainConfig === 'function'
225+
? baseModule.getChainConfig()
226+
: null;
218227
const effChain =
219228
typeof mod.getChainConfig === 'function' ? mod.getChainConfig() : null;
220229
if (baseChain && effChain) {
@@ -256,9 +265,15 @@ describe('rpc override', () => {
256265
// eslint-disable-next-line no-console
257266
console.log('[rpc-override] client rpcUrl:', cc.rpcUrl);
258267
// eslint-disable-next-line no-console
259-
console.log('[rpc-override] client viem rpcUrls.default:', cc.viemConfig.rpcUrls.default.http);
268+
console.log(
269+
'[rpc-override] client viem rpcUrls.default:',
270+
cc.viemConfig.rpcUrls.default.http
271+
);
260272
// eslint-disable-next-line no-console
261-
console.log('[rpc-override] client viem rpcUrls.public:', (cc.viemConfig.rpcUrls as any)['public']?.http);
273+
console.log(
274+
'[rpc-override] client viem rpcUrls.public:',
275+
(cc.viemConfig.rpcUrls as any)['public']?.http
276+
);
262277

263278
expect(cc.rpcUrl).toBe(TEST_RPC);
264279
expect(cc.viemConfig.rpcUrls.default.http[0]).toBe(TEST_RPC);

0 commit comments

Comments
 (0)