Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ui/client/composables/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ function clearTaskResult(task: RunnerTask) {
const node = explorerTree.nodes.get(task.id)
if (node) {
node.state = undefined
// update task mode to allow change icon on skipped tests
task.mode = 'run'
node.duration = undefined
if (isTaskSuite(task)) {
for (const t of task.tasks) {
Expand Down
22 changes: 17 additions & 5 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1071,12 +1071,24 @@ export class Vitest {
throw new Error(`Task ${id} was not found`)
}

const taskNamePattern = task.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
const reportedTask = this.state.getReportedEntityById(id)
if (!reportedTask) {
throw new Error(`Test specification for task ${id} was not found`)
}

await this.changeNamePattern(
taskNamePattern,
[task.file.filepath],
'tasks' in task ? 'rerun suite' : 'rerun test',
const specifications = [reportedTask.toTestSpecification()]
await Promise.all([
this.report(
'onWatcherRerun',
[task.file.filepath],
'tasks' in task ? 'rerun suite' : 'rerun test',
),
...this._onUserTestsRerun.map(fn => fn(specifications)),
])
await this.runFiles(specifications, false)
await this.report(
'onWatcherStart',
['module' in reportedTask ? reportedTask.module.task : reportedTask.task],
)
}

Expand Down
Loading