Skip to content

Commit

Permalink
fix: always report failed test in junit reporter (#2632)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jan 10, 2023
1 parent 4745eaa commit 83da2ec
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 83da2ec

Please sign in to comment.