Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always report failed test in junit reporter #2632

Merged
merged 1 commit into from Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/vitest/src/node/reporters/junit.ts
Expand Up @@ -167,7 +167,8 @@ export class JUnitReporter implements Reporter {
await this.logger.log('<skipped/>')

if (task.result?.state === 'fail') {
const promises = task.result.errors?.map(async (error) => {
const errors = task.result.errors?.length ? task.result.errors : [task.result.error]
for (const error of errors) {
await this.writeElement('failure', {
message: error?.message,
type: error?.name ?? error?.nameStr,
Expand All @@ -177,8 +178,7 @@ export class JUnitReporter implements Reporter {

await this.writeErrorDetails(error)
})
}) || []
await Promise.all(promises)
}
}
})
}
Expand Down