Skip to content

Commit 4b93bd3

Browse files
committed
fix: env var uppercase
1 parent 1dd9186 commit 4b93bd3

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

packages/sdk-multichain/src/domain/index.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ t.describe("Logger", () => {
222222

223223
t.beforeEach(() => {
224224
t.vi.clearAllMocks();
225-
delete process.env.debug;
225+
delete process.env.DEBUG;
226226
mockStoreClient.getDebug.mockClear();
227227
});
228228

@@ -261,8 +261,8 @@ t.describe("Logger", () => {
261261
});
262262

263263
t.describe('isEnabled', () => {
264-
t.it('should return true when namespace is in process.env.debug', async () => {
265-
process.env.debug = 'metamask-sdk:core';
264+
t.it('should return true when namespace is in process.env.DEBUG', async () => {
265+
process.env.DEBUG = 'metamask-sdk:core';
266266

267267
const result = await isEnabled('metamask-sdk:core', mockStoreClient as any);
268268

@@ -271,30 +271,30 @@ t.describe("Logger", () => {
271271
});
272272

273273
t.it('should return true when wildcard matches namespace', async () => {
274-
process.env.debug = 'metamask-sdk:*';
274+
process.env.DEBUG = 'metamask-sdk:*';
275275

276276
const result = await isEnabled('metamask-sdk:core', mockStoreClient as any);
277277

278278
t.expect(result).toBe(true);
279279
});
280280

281281
t.it('should return true when universal wildcard is used', async () => {
282-
process.env.debug = '*';
282+
process.env.DEBUG = '*';
283283

284284
const result = await isEnabled('metamask-sdk', mockStoreClient as any);
285285

286286
t.expect(result).toBe(true);
287287
});
288288

289-
t.it('should return false when namespace is not in process.env.debug', async () => {
290-
process.env.debug = 'other-namespace';
289+
t.it('should return false when namespace is not in process.env.DEBUG', async () => {
290+
process.env.DEBUG = 'other-namespace';
291291

292292
const result = await isEnabled('metamask-sdk:core', mockStoreClient as any);
293293

294294
t.expect(result).toBe(false);
295295
});
296296

297-
t.it('should check storage when process.env.debug is not set', async () => {
297+
t.it('should check storage when process.env.DEBUG is not set', async () => {
298298
mockStoreClient.getDebug.mockResolvedValue('metamask-sdk:provider');
299299

300300
const result = await isEnabled('metamask-sdk:provider', mockStoreClient as any);
@@ -311,8 +311,8 @@ t.describe("Logger", () => {
311311
t.expect(result).toBe(false);
312312
});
313313

314-
t.it('should prioritize process.env.debug over storage', async () => {
315-
process.env.debug = 'metamask-sdk:core';
314+
t.it('should prioritize process.env.DEBUG over storage', async () => {
315+
process.env.DEBUG = 'metamask-sdk:core';
316316
mockStoreClient.getDebug.mockResolvedValue('metamask-sdk:provider');
317317

318318
const result = await isEnabled('metamask-sdk:core', mockStoreClient as any);

packages/sdk-multichain/src/domain/logger/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ export const isEnabled = async (
7878
namespace: LoggerNameSpaces,
7979
storage: StoreClient,
8080
) => {
81-
if (process?.env?.debug) {
82-
const {debug} = process.env
83-
return isNamespaceEnabled(debug, namespace);
81+
if (process?.env?.DEBUG) {
82+
const {DEBUG} = process.env
83+
return isNamespaceEnabled(DEBUG, namespace);
8484
}
8585

8686
const storageDebug = await storage.getDebug();

0 commit comments

Comments
 (0)