@@ -62,7 +62,7 @@ describe("createBashTool @vercel/sandbox integration", () => {
6262 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
6363 const result = ( await tools . bash . execute (
6464 { command : "ls -la" } ,
65- opts
65+ opts ,
6666 ) ) as CommandResult ;
6767
6868 expect ( result . exitCode ) . toBe ( 0 ) ;
@@ -82,16 +82,17 @@ describe("createBashTool @vercel/sandbox integration", () => {
8282 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
8383 const result = ( await tools . bash . execute (
8484 { command : "ls src" } ,
85- opts
85+ opts ,
8686 ) ) as CommandResult ;
8787
88+ expect ( result . stderr ) . toBe ( "" ) ;
8889 expect ( result . exitCode ) . toBe ( 0 ) ;
8990 expect ( result . stdout . trim ( ) ) . toBe ( "index.ts\nutils" ) ;
9091 } , 30000 ) ;
9192 } ) ;
9293
9394 describe ( "find command" , ( ) => {
94- it ( " find . -name '*.ts' finds TypeScript files" , async ( ) => {
95+ it ( ` find . -name '*.ts' finds TypeScript files` , async ( ) => {
9596 const dest = uniqueDir ( ) ;
9697 const { tools } = await createBashTool ( {
9798 sandbox : vercelSandbox ,
@@ -102,17 +103,18 @@ describe("createBashTool @vercel/sandbox integration", () => {
102103 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
103104 const result = ( await tools . bash . execute (
104105 { command : "find . -name '*.ts'" } ,
105- opts
106+ opts ,
106107 ) ) as CommandResult ;
107108
109+ expect ( result . stderr ) . toBe ( "" ) ;
108110 expect ( result . exitCode ) . toBe ( 0 ) ;
109111 expect ( result . stdout ) . toContain ( "index.ts" ) ;
110112 expect ( result . stdout ) . toContain ( "helpers.ts" ) ;
111113 expect ( result . stdout ) . toContain ( "format.ts" ) ;
112114 expect ( result . stdout ) . not . toContain ( "package.json" ) ;
113115 } , 30000 ) ;
114116
115- it ( " find . -name '*.json' finds JSON files" , async ( ) => {
117+ it ( ` find . -name '*.json' finds JSON files` , async ( ) => {
116118 const dest = uniqueDir ( ) ;
117119 const { tools } = await createBashTool ( {
118120 sandbox : vercelSandbox ,
@@ -123,11 +125,11 @@ describe("createBashTool @vercel/sandbox integration", () => {
123125 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
124126 const result = ( await tools . bash . execute (
125127 { command : "find . -name '*.json'" } ,
126- opts
128+ opts ,
127129 ) ) as CommandResult ;
128-
130+ expect ( result . stderr ) . toBe ( "" ) ;
129131 expect ( result . exitCode ) . toBe ( 0 ) ;
130- expect ( result . stdout . trim ( ) ) . toBe ( "./package.json" ) ;
132+ expect ( result . stdout ) . toBe ( "./package.json\n " ) ;
131133 } , 30000 ) ;
132134 } ) ;
133135
@@ -143,7 +145,7 @@ describe("createBashTool @vercel/sandbox integration", () => {
143145 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
144146 const result = ( await tools . bash . execute (
145147 { command : "grep -r 'export' ." } ,
146- opts
148+ opts ,
147149 ) ) as CommandResult ;
148150
149151 expect ( result . stderr ) . toBe ( "" ) ;
@@ -164,12 +166,12 @@ describe("createBashTool @vercel/sandbox integration", () => {
164166 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
165167 const result = ( await tools . bash . execute (
166168 { command : "grep -r 'hello' ." } ,
167- opts
169+ opts ,
168170 ) ) as CommandResult ;
169171
170172 expect ( result . exitCode ) . toBe ( 0 ) ;
171173 expect ( result . stdout . trim ( ) ) . toBe (
172- './src/index.ts:export const hello = "world";'
174+ './src/index.ts:export const hello = "world";' ,
173175 ) ;
174176 } , 30000 ) ;
175177 } ) ;
@@ -186,7 +188,7 @@ describe("createBashTool @vercel/sandbox integration", () => {
186188 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
187189 const result = ( await tools . bash . execute (
188190 { command : "cat src/index.ts" } ,
189- opts
191+ opts ,
190192 ) ) as CommandResult ;
191193
192194 expect ( result . exitCode ) . toBe ( 0 ) ;
@@ -204,12 +206,12 @@ describe("createBashTool @vercel/sandbox integration", () => {
204206 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
205207 const result = ( await tools . bash . execute (
206208 { command : "cat package.json" } ,
207- opts
209+ opts ,
208210 ) ) as CommandResult ;
209211
210212 expect ( result . exitCode ) . toBe ( 0 ) ;
211213 expect ( result . stdout ) . toBe (
212- '{"name": "test-project", "version": "1.0.0"}'
214+ '{"name": "test-project", "version": "1.0.0"}' ,
213215 ) ;
214216 } , 30000 ) ;
215217 } ) ;
@@ -225,7 +227,7 @@ describe("createBashTool @vercel/sandbox integration", () => {
225227 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
226228 const result = ( await tools . bash . execute (
227229 { command : "pwd" } ,
228- opts
230+ opts ,
229231 ) ) as CommandResult ;
230232
231233 expect ( result . exitCode ) . toBe ( 0 ) ;
@@ -243,7 +245,7 @@ describe("createBashTool @vercel/sandbox integration", () => {
243245 assert ( tools . bash . execute , "bash.execute should be defined" ) ;
244246 const result = ( await tools . bash . execute (
245247 { command : "pwd" } ,
246- opts
248+ opts ,
247249 ) ) as CommandResult ;
248250
249251 expect ( result . exitCode ) . toBe ( 0 ) ;
@@ -263,7 +265,7 @@ describe("createBashTool @vercel/sandbox integration", () => {
263265 assert ( tools . readFile . execute , "readFile.execute should be defined" ) ;
264266 const result = ( await tools . readFile . execute (
265267 { path : `${ dest } /src/index.ts` } ,
266- opts
268+ opts ,
267269 ) ) as { content : string } ;
268270
269271 expect ( result . content ) . toBe ( 'export const hello = "world";' ) ;
@@ -287,12 +289,12 @@ describe("createBashTool @vercel/sandbox integration", () => {
287289 path : "newfile.txt" ,
288290 content : "Hello, World!" ,
289291 } ,
290- opts
292+ opts ,
291293 ) ;
292294
293295 const result = ( await tools . bash . execute (
294296 { command : "cat newfile.txt" } ,
295- opts
297+ opts ,
296298 ) ) as CommandResult ;
297299
298300 expect ( result . stdout ) . toBe ( "Hello, World!" ) ;
0 commit comments