benchmark.js icon indicating copy to clipboard operation
benchmark.js copied to clipboard

allow trigger error, for better async test

Open bluelovers opened this issue 7 years ago • 2 comments

bluelovers avatar Jun 02 '18 23:06 bluelovers

https://github.com/bluelovers/mocha-benchmark/blob/671c2f422d57662cb50eb2e3bb526ea12738f7ae/mocha_benchmark.ts#L297-L331

bluelovers avatar Jun 03 '18 03:06 bluelovers

I like this change. I will adapt this to my fork.

With this I would add a isAsyncFunction check like the one I implemented in mongoose. Then if you pass an async function to the benchmarks, it should wrap the async function in the existing defer mode and resolve and reject can be assigned and it should work like a charm.

Uzlopak avatar Mar 09 '22 16:03 Uzlopak