tinybench
tinybench copied to clipboard
reorder teardown callback to after the error event, and setResults.
fix for #61
Change order of operations to
- emit error event if it exists
- calculate results
- call teardown hook
- emit cycle event
I'm not sure why you would ever call teardown before dealing with an error that was part of the test run.
Putting teardown after setResults allows a person to purge the samples to avoid memory starvation in longer test runs.