File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,13 @@ import { useAvailableScripts } from "./useAvailableScripts";
1515// Define types for our mock
1616type 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-
2618describe ( "useAvailableScripts" , ( ) => {
2719 const mockListScripts = mock ( ) as unknown as ListScriptsMock ;
2820
2921 beforeEach ( ( ) => {
3022 // Mock window.api attached to the global window
31- ( global . window as unknown as CustomWindow ) . api = {
23+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
24+ ( global . window as any ) . api = {
3225 workspace : {
3326 listScripts : mockListScripts ,
3427 } ,
@@ -37,7 +30,8 @@ describe("useAvailableScripts", () => {
3730
3831 afterEach ( ( ) => {
3932 mock . restore ( ) ;
40- delete ( global . window as unknown as CustomWindow ) . api ;
33+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
34+ delete ( global . window as any ) . api ;
4135 } ) ;
4236
4337 it ( "should fetch and return executable scripts" , async ( ) => {
You can’t perform that action at this time.
0 commit comments