Skip to content

Commit a8c3093

Browse files
author
Leemalin Moodley
committed
fix: fixed code style issues
1 parent 8894ffa commit a8c3093

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/main/frontend/setupTests.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,22 @@ vi.stubGlobal("IntersectionObserver", IntersectionObserverMock);
1111

1212
// Ensure a functional localStorage implementation for tests that persist user preferences.
1313
if (
14-
!('localStorage' in window) ||
15-
typeof window.localStorage?.getItem !== 'function' ||
16-
typeof window.localStorage?.setItem !== 'function'
14+
!("localStorage" in window) ||
15+
typeof window.localStorage?.getItem !== "function" ||
16+
typeof window.localStorage?.setItem !== "function"
1717
) {
1818
const store: Record<string, string> = {};
1919
const localStoragePolyfill = {
2020
getItem: (key: string) => (key in store ? store[key] : null),
21-
setItem: (key: string, value: string) => { store[key] = String(value); },
22-
removeItem: (key: string) => { delete store[key]; },
23-
clear: () => { Object.keys(store).forEach(k => delete store[k]); },
21+
setItem: (key: string, value: string) => {
22+
store[key] = String(value);
23+
},
24+
removeItem: (key: string) => {
25+
delete store[key];
26+
},
27+
clear: () => {
28+
Object.keys(store).forEach((k) => delete store[k]);
29+
},
2430
};
2531
// @ts-expect-error override for test environment
2632
window.localStorage = localStoragePolyfill;

0 commit comments

Comments
 (0)