(result: TaskResult, err: unknown, diffOptions: DiffOptions | undefined)
| 785 | } |
| 786 | |
| 787 | function failTask(result: TaskResult, err: unknown, diffOptions: DiffOptions | undefined) { |
| 788 | if (err instanceof PendingError) { |
| 789 | result.state = 'skip' |
| 790 | result.note = err.note |
| 791 | result.pending = true |
| 792 | return |
| 793 | } |
| 794 | |
| 795 | if (err instanceof TestRunAbortError) { |
| 796 | result.state = 'skip' |
| 797 | result.note = err.message |
| 798 | return |
| 799 | } |
| 800 | |
| 801 | result.state = 'fail' |
| 802 | const errors = Array.isArray(err) ? err : [err] |
| 803 | for (const e of errors) { |
| 804 | const errors = e instanceof AggregateError |
| 805 | ? e.errors.map(e => processError(e, diffOptions)) |
| 806 | : [processError(e, diffOptions)] |
| 807 | result.errors ??= [] |
| 808 | result.errors.push(...errors) |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | function markTasksAsSkipped(suite: Suite, runner: VitestRunner) { |
| 813 | suite.tasks.forEach((t) => { |
no test coverage detected