File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ describe('TestRunner', () => {
9191 } )
9292
9393 describe ( 'run and stop' , ( ) => {
94- it ( 'should prevent concurrent runs and handle environment variables' , async ( ) => {
94+ it ( 'should stop existing run and restart with environment variables' , async ( ) => {
9595 vi . mocked ( spawn ) . mockReturnValue ( mockChild )
9696 const payload : RunnerRequestBody = {
9797 uid : 'test-1' ,
@@ -104,9 +104,8 @@ describe('TestRunner', () => {
104104 const firstRun = testRunner . run ( payload )
105105 await new Promise ( ( resolve ) => setTimeout ( resolve , 10 ) )
106106
107- await expect ( testRunner . run ( payload ) ) . rejects . toThrow (
108- 'A test run is already in progress'
109- )
107+ // A concurrent run stops the existing process and starts a new one
108+ await expect ( testRunner . run ( payload ) ) . resolves . toBeUndefined ( )
110109
111110 const env = vi . mocked ( spawn ) . mock . calls [ 0 ] [ 2 ] ?. env as Record <
112111 string ,
You can’t perform that action at this time.
0 commit comments