@@ -623,7 +623,13 @@ describe('Dev Commands', () => {
623
623
try {
624
624
const result = await runCLI ( [ 'dev' , tempDir ] )
625
625
// Should handle permission errors gracefully
626
- expect ( result . exitCode ) . toBe ( 1 )
626
+ // The runCLI function returns exitCode -13 for EACCES errors, or 1 for other errors
627
+ expect ( result . exitCode ) . toBeOneOf ( [ 1 , - 13 ] )
628
+
629
+ // If it's a permission error, stderr should contain error info
630
+ if ( result . exitCode === - 13 ) {
631
+ expect ( result . stderr ) . toMatch ( / P r o c e s s e r r o r .* E A C C E S | p e r m i s s i o n d e n i e d / i)
632
+ }
627
633
}
628
634
catch ( error ) {
629
635
// Permission errors during process spawn are also acceptable
@@ -817,7 +823,9 @@ describe('Dev Commands', () => {
817
823
expect ( result1 . exitCode ) . toBe ( 0 )
818
824
}
819
825
else {
820
- expect ( cleanOutput1 ) . toMatch ( / ✅ b u n \. s h | S u c c e s s f u l l y i n s t a l l e d | N o n e w f i l e s i n s t a l l e d / )
826
+ // Check for success indicators, allowing for installation warnings
827
+ const hasSuccessIndicator = cleanOutput1 . match ( / ✅ b u n \. s h | S u c c e s s f u l l y i n s t a l l e d | N o n e w f i l e s i n s t a l l e d | E n v i r o n m e n t a c t i v a t e d / )
828
+ expect ( hasSuccessIndicator ) . toBeTruthy ( )
821
829
const ok1 = cleanOutput1 . includes ( 'Successfully set up environment' ) || cleanOutput1 . includes ( 'Environment activated' )
822
830
expect ( ok1 ) . toBe ( true )
823
831
}
@@ -834,7 +842,9 @@ describe('Dev Commands', () => {
834
842
expect ( result2 . exitCode ) . toBe ( 0 )
835
843
}
836
844
else {
837
- expect ( cleanOutput2 ) . toMatch ( / ✅ b u n \. s h | S u c c e s s f u l l y i n s t a l l e d | N o n e w f i l e s i n s t a l l e d / )
845
+ // Check for success indicators, allowing for installation warnings
846
+ const hasSuccessIndicator = cleanOutput2 . match ( / ✅ b u n \. s h | S u c c e s s f u l l y i n s t a l l e d | N o n e w f i l e s i n s t a l l e d | E n v i r o n m e n t a c t i v a t e d / )
847
+ expect ( hasSuccessIndicator ) . toBeTruthy ( )
838
848
const ok2 = cleanOutput2 . includes ( 'Successfully set up environment' ) || cleanOutput2 . includes ( 'Environment activated' )
839
849
expect ( ok2 ) . toBe ( true )
840
850
}
0 commit comments