From f4f7b6e13f93af9ae47e29981cf4f0581e01c7a0 Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Sat, 9 Dec 2023 22:29:41 -0500 Subject: [PATCH] test: fix localStorage condition in mock --- __tests__/store/store.test.ts | 2 +- __tests__/wallets/manager.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/store/store.test.ts b/__tests__/store/store.test.ts index 9005bcd..fb1f1cd 100644 --- a/__tests__/store/store.test.ts +++ b/__tests__/store/store.test.ts @@ -20,7 +20,7 @@ const localStorageMock = (() => { clear: () => (store = {}) } })() -if (!localStorage) { +if (typeof localStorage === 'undefined') { Object.defineProperty(global, 'localStorage', { value: localStorageMock }) diff --git a/__tests__/wallets/manager.test.ts b/__tests__/wallets/manager.test.ts index 0de9e4e..aa3ea3e 100644 --- a/__tests__/wallets/manager.test.ts +++ b/__tests__/wallets/manager.test.ts @@ -22,7 +22,7 @@ const localStorageMock = (() => { clear: () => (store = {}) } })() -if (!localStorage) { +if (typeof localStorage === 'undefined') { Object.defineProperty(global, 'localStorage', { value: localStorageMock })