Clear and concise description of the problem
There is no way for a reporter to know if a file is currently being collected. If the collection phase is slow (e.g. transforms 100000 files due to barrel files), end users have no idea what is going on. Reporters cannot inform user about slow files.
Suggested solution
Before collection for a file starts, inform reporters on onTaskUpdate hook that file is in queue. It could be something like File & { mode: 'queued' }. Next expected state after this is run.
Somewhere around here:
|
const file = createFileTask(filepath, config.root, config.name, runner.pool) |
|
|
|
runner.onCollectStart?.(file) |
|
|
|
clearCollectorContext(filepath, runner) |
Alternative
No response
Additional context
The summary of #6893 could display queued files even before they start running.
Validations
Clear and concise description of the problem
There is no way for a reporter to know if a file is currently being collected. If the collection phase is slow (e.g. transforms 100000 files due to barrel files), end users have no idea what is going on. Reporters cannot inform user about slow files.
Suggested solution
Before collection for a file starts, inform reporters on
onTaskUpdatehook that file is in queue. It could be something likeFile & { mode: 'queued' }. Next expected state after this isrun.Somewhere around here:
vitest/packages/runner/src/collect.ts
Lines 31 to 35 in 0b08bc1
Alternative
No response
Additional context
The summary of #6893 could display queued files even before they start running.
Validations