@@ -5,40 +5,8 @@ import {
55 createMockFileSystemExecutor ,
66} from '../../../../test-utils/mock-executors.ts' ;
77import { schema , handler , launch_mac_appLogic } from '../launch_mac_app.ts' ;
8- import { allText , createMockToolHandlerContext } from '../../../../test-utils/test-helpers.ts' ;
9-
10- const runLogic = async ( logic : ( ) => Promise < unknown > ) => {
11- const { result, run } = createMockToolHandlerContext ( ) ;
12- const response = await run ( logic ) ;
13-
14- if (
15- response &&
16- typeof response === 'object' &&
17- 'content' in ( response as Record < string , unknown > )
18- ) {
19- return response as {
20- content : Array < { type : string ; text ?: string ; data ?: string ; mimeType ?: string } > ;
21- isError ?: boolean ;
22- nextStepParams ?: unknown ;
23- } ;
24- }
25-
26- const text = result . text ( ) ;
27- const textContent = text . length > 0 ? [ { type : 'text' as const , text } ] : [ ] ;
28- const imageContent = result . attachments . map ( ( attachment ) => ( {
29- type : 'image' as const ,
30- data : attachment . data ,
31- mimeType : attachment . mimeType ,
32- } ) ) ;
33-
34- return {
35- content : [ ...textContent , ...imageContent ] ,
36- isError : result . isError ( ) ? true : undefined ,
37- nextStepParams : result . nextStepParams ,
38- attachments : result . attachments ,
39- text,
40- } ;
41- } ;
8+ import { allText , runLogic } from '../../../../test-utils/test-helpers.ts' ;
9+
4210
4311describe ( 'launch_mac_app plugin' , ( ) => {
4412 describe ( 'Export Field Validation (Literal)' , ( ) => {
0 commit comments