@@ -106,7 +106,7 @@ describe('t44 lifecycle', function () {
106106 await writeFile ( join ( repoDir , '.workspace' , 'workspace.yaml' ) , workspaceYaml )
107107 } )
108108
109- it ( 'init — t44 info --yes initializes workspace' , async ( ) => {
109+ it ( 'init --yes initializes workspace' , async ( ) => {
110110 const { exitCode, stdout, stderr } = await runT44 ( 'info' )
111111
112112 if ( exitCode !== 0 ) {
@@ -130,6 +130,61 @@ describe('t44 lifecycle', function () {
130130 expect ( signingKeyStat . isFile ( ) ) . toBe ( true )
131131 } , 15_000 )
132132
133+ it ( 'activate — bin/activate.ts outputs shell exports' , async ( ) => {
134+ const activateBin = join ( import . meta. dir , '../../bin/activate.ts' )
135+ const proc = Bun . spawn ( [ activateBin , '--yes' ] , {
136+ env,
137+ cwd : repoDir ,
138+ stdout : 'pipe' ,
139+ stderr : 'pipe' ,
140+ stdin : 'pipe' ,
141+ } )
142+ proc . stdin . end ( )
143+
144+ const timeout = setTimeout ( ( ) => proc . kill ( ) , 15_000 )
145+
146+ const stdoutChunks : string [ ] = [ ]
147+ const stderrChunks : string [ ] = [ ]
148+
149+ const verbose = ! ! process . env . VERBOSE
150+
151+ const stdoutReader = new WritableStream ( {
152+ write ( chunk ) {
153+ const text = new TextDecoder ( ) . decode ( chunk )
154+ stdoutChunks . push ( text )
155+ if ( verbose ) process . stdout . write ( text )
156+ }
157+ } )
158+
159+ const stderrReader = new WritableStream ( {
160+ write ( chunk ) {
161+ const text = new TextDecoder ( ) . decode ( chunk )
162+ stderrChunks . push ( text )
163+ if ( verbose ) process . stderr . write ( text )
164+ }
165+ } )
166+
167+ const [ exitCode ] = await Promise . all ( [
168+ proc . exited ,
169+ proc . stdout . pipeTo ( stdoutReader ) ,
170+ proc . stderr . pipeTo ( stderrReader ) ,
171+ ] )
172+
173+ clearTimeout ( timeout )
174+
175+ const stdout = stdoutChunks . join ( '' )
176+ const stderr = stderrChunks . join ( '' )
177+
178+ if ( exitCode !== 0 ) {
179+ console . log ( 'STDOUT:' , stdout )
180+ console . log ( 'STDERR:' , stderr )
181+ }
182+
183+ expect ( exitCode ) . toBe ( 0 )
184+ expect ( stdout . length ) . toBeGreaterThan ( 0 )
185+ expect ( stdout ) . toContain ( 'export ' )
186+ } , 15_000 )
187+
133188 it ( 'info — displays workspace information' , async ( ) => {
134189 const { exitCode, stdout, stderr } = await runT44 ( 'info' , '--full' )
135190
0 commit comments