Skip to content

Commit 8622ea9

Browse files
committed
🤖 fix: type errors in test to pass static checks
Change-Id: I5b0450283bd16ffa7242db6419139126b9ef3eb1 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent bd7d731 commit 8622ea9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/browser/hooks/useAvailableScripts.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ import { useAvailableScripts } from "./useAvailableScripts";
1515
// Define types for our mock
1616
type ListScriptsMock = Mock<() => Promise<{ success: boolean; data?: unknown[]; error?: string }>>;
1717

18+
interface CustomWindow extends Window {
19+
api?: {
20+
workspace: {
21+
listScripts: ListScriptsMock;
22+
};
23+
};
24+
}
25+
1826
describe("useAvailableScripts", () => {
1927
const mockListScripts = mock() as unknown as ListScriptsMock;
2028

2129
beforeEach(() => {
2230
// Mock window.api attached to the global window
23-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
24-
(global.window as any).api = {
31+
(global.window as unknown as CustomWindow).api = {
2532
workspace: {
2633
listScripts: mockListScripts,
2734
},
@@ -30,8 +37,7 @@ describe("useAvailableScripts", () => {
3037

3138
afterEach(() => {
3239
mock.restore();
33-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
34-
delete (global.window as any).api;
40+
delete (global.window as unknown as CustomWindow).api;
3541
});
3642

3743
it("should fetch and return executable scripts", async () => {

0 commit comments

Comments
 (0)