diff --git a/frontend/__mocks__/localStorage.ts b/frontend/__mocks__/localStorage.ts index e920671557d..c727e8312f0 100644 --- a/frontend/__mocks__/localStorage.ts +++ b/frontend/__mocks__/localStorage.ts @@ -1,11 +1,11 @@ let _localStorage = {}; (window as any).localStorage = (window as any).sessionStorage = { - setItem(key, value) { + setItem(key: string, value: string) { Object.assign(_localStorage, { [key]: value} ); }, - getItem(key) { - return _localStorage[key] || null; + getItem(key: string): string | null { + return _localStorage.hasOwnProperty(key) ? _localStorage[key] : null; }, clear() { _localStorage = {};