Skip to content

Commit

Permalink
fix(browser): don't get stuck after the manual page refresh
Browse files Browse the repository at this point in the history
Fixes #5822
  • Loading branch information
sheremet-va committed Jun 2, 2024
1 parent 5ebb3ab commit 2220bb3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/browser/src/client/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ client.ws.addEventListener('open', async () => {

debug('test files', testFiles.join(', '))

// TODO: fail tests suite because no tests found?
if (!testFiles.length) {
await done()
return
}

const runningFiles = new Set<string>(testFiles)

channel.addEventListener('message', async (e: MessageEvent<IframeChannelEvent>): Promise<void> => {
Expand Down Expand Up @@ -168,7 +162,10 @@ client.ws.addEventListener('open', async () => {
}
})

await createTesters(testFiles)
// if page was refreshed, there will be no test files
// createTesters will be called again when tests are running in the UI
if (testFiles.length)
await createTesters(testFiles)
})

async function createTesters(testFiles: string[]) {
Expand Down

0 comments on commit 2220bb3

Please sign in to comment.