ava: Explore storing an error object, rather than directly capturing a stack trace

Issuehunt badges

For asynchronous assertions we capture a stack trace before the assertion is run. Inspired by this comment by @alxandr we should explore storing an error object, and reading the stack trace later if it’s actually necessary:

… instead of passing the stack trace itself, an error object could be passed. This has less performance impact, because then the stack trace is only generated on demand (this might even be something that could improve the performance of your existing async tests).

See lib/test.js and lib/assert.js.


IssueHunt Summary

mihai-dinu mihai-dinu has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (10 by maintainers)

Most upvoted comments

@sindresorhus has rewarded $36.00 to @mihai-dinu. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00

Sorry have been busy for a while, so could not work on the issue. Please feel free to give it a go