fix(state): prefs test localStorage mock typing
This commit is contained in:
@@ -3,13 +3,13 @@ import { getPrefs, setPrefs } from '../prefs';
|
|||||||
|
|
||||||
describe('prefs', () => {
|
describe('prefs', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
const store: Record<string, string> = {};
|
||||||
vi.stubGlobal('localStorage', {
|
vi.stubGlobal('localStorage', {
|
||||||
store: {} as Record<string, string>,
|
|
||||||
getItem(key: string) {
|
getItem(key: string) {
|
||||||
return this.store[key] ?? null;
|
return store[key] ?? null;
|
||||||
},
|
},
|
||||||
setItem(key: string, value: string) {
|
setItem(key: string, value: string) {
|
||||||
this.store[key] = value;
|
store[key] = value;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user