@@ -100,6 +100,7 @@ describe("runProjectSubcommand", () => {
100100
101101 expect ( result . code ) . toBe ( 0 ) ;
102102 expect ( result . stdout . join ( "\n" ) ) . toContain ( "alias: codebase web-build" ) ;
103+ expect ( result . stdout . join ( "\n" ) ) . toContain ( "default: 1800" ) ;
103104 } ) ;
104105
105106 it ( "prints pull help without treating the flag as a project id" , async ( ) => {
@@ -267,6 +268,39 @@ describe("runProjectSubcommand", () => {
267268 expect ( result . stdout . join ( "\n" ) ) . toContain ( "preview: https://codebase.design/preview/proj-1" ) ;
268269 } ) ;
269270
271+ it ( "keeps the default wait alive beyond ten minutes" , async ( ) => {
272+ let now = 0 ;
273+ const nowSpy = vi . spyOn ( Date , "now" ) . mockImplementation ( ( ) => now ) ;
274+ const client = fakeClient ( {
275+ status : { sessionId : "sess-1" , status : "building" , projectId : "proj-1" } ,
276+ preview : { ok : true , previewPath : "/preview/proj-1" } ,
277+ } ) as ProjectClient ;
278+ client . getBuildStatus = async ( ) => ( {
279+ sessionId : "sess-1" ,
280+ status : now >= 11 * 60_000 ? "completed" : "building" ,
281+ projectId : "proj-1" ,
282+ } ) ;
283+
284+ try {
285+ const stdout : string [ ] = [ ] ;
286+ const code = await runProjectSubcommand ( [ "project" , "build" , "--wait" , "Build" , "a" , "demo" ] , {
287+ client,
288+ stdout : ( message ) => stdout . push ( message ) ,
289+ stderr : ( ) => { } ,
290+ sleep : async ( ms ) => {
291+ now += ms ;
292+ } ,
293+ handoffStore : null ,
294+ } ) ;
295+
296+ expect ( code ) . toBe ( 0 ) ;
297+ expect ( now ) . toBeGreaterThanOrEqual ( 11 * 60_000 ) ;
298+ expect ( stdout . join ( "\n" ) ) . toContain ( "build sess-1: completed" ) ;
299+ } finally {
300+ nowSpy . mockRestore ( ) ;
301+ }
302+ } ) ;
303+
270304 it ( "fails a terminal build and prints the server reason" , async ( ) => {
271305 const result = await runProject (
272306 [ "project" , "build" , "--wait" , "Build" , "a" , "demo" ] ,
0 commit comments