Skip to content

Commit

Permalink
fix(bench): throw root cause (#2137)
Browse files Browse the repository at this point in the history
Co-authored-by: Nick McCurdy <nick@nickmccurdy.com>
  • Loading branch information
azaleta and nickmccurdy committed Oct 14, 2022
1 parent 8c80b8f commit b2c332e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vitest/src/runtime/run.ts
Expand Up @@ -369,7 +369,9 @@ async function runBenchmarkSuite(suite: Suite) {
}
})
benchmark.task!.addEventListener('error', (e) => {
defer.reject(e)
const task = e.task
const _benchmark = benchmarkMap[task.name || '']
defer.reject(_benchmark ? task.result!.error : e)
})
})

Expand Down

0 comments on commit b2c332e

Please sign in to comment.