@@ -807,20 +807,20 @@ describe('Dev Commands', () => {
807
807
expect ( cleanOutput2 ) . toContain ( '✅ bun.sh' )
808
808
expect ( cleanOutput2 ) . toContain ( 'Successfully set up environment' )
809
809
810
- // Second run should be faster (allow more variance for CI environments)
811
- const expectedMultiplier = process . env . CI === 'true' || process . env . GITHUB_ACTIONS === 'true' ? 2.0 : 1.5
810
+ // Test caching behavior rather than strict timing
811
+ // The key is that both runs complete successfully, indicating caching works
812
+ expect ( duration1 ) . toBeGreaterThan ( 0 )
813
+ expect ( duration2 ) . toBeGreaterThan ( 0 )
812
814
815
+ // In CI, we're more lenient about timing but still test the core functionality
813
816
if ( process . env . CI === 'true' || process . env . GITHUB_ACTIONS === 'true' ) {
814
- // In CI, just ensure both runs complete successfully
815
- // The important thing is that both runs work, not the exact timing
816
- expect ( duration1 ) . toBeGreaterThan ( 0 )
817
- expect ( duration2 ) . toBeGreaterThan ( 0 )
818
- expect ( result1 . exitCode ) . toBe ( 0 )
819
- expect ( result2 . exitCode ) . toBe ( 0 )
820
- }
821
- else {
817
+ // In CI, just ensure both runs complete and don't take an unreasonable amount of time
818
+ // (more than 30 seconds would indicate a serious problem)
819
+ expect ( duration1 ) . toBeLessThan ( 30000 )
820
+ expect ( duration2 ) . toBeLessThan ( 30000 )
821
+ } else {
822
822
// In local environment, expect the second run to be faster
823
- expect ( duration2 ) . toBeLessThan ( duration1 * expectedMultiplier )
823
+ expect ( duration2 ) . toBeLessThan ( duration1 * 1.5 )
824
824
}
825
825
} , 60000 )
826
826
} )
0 commit comments