-
Notifications
You must be signed in to change notification settings - Fork 332
allow trigger error, for better async test #205
base: main
Are you sure you want to change the base?
Conversation
* 'master' of https://github.com/bestiejs/benchmark.js: Remove sites from copyright header and package.json. Remove npm ci use from travis since it is called automatically. Update deps. chore: upgrade npm (bestiejs#202) chore: use npm ci (bestiejs#201) chore: add Node.js 8 and 10 (bestiejs#199) chore: remove Node.js 4 (bestiejs#203)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should drop the changes to package.json
, if you want to get this request merged.
bench = clone._original; | ||
|
||
var event = Event('error'); | ||
clone.error = event.message = error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not weird to set the error object as both error
and message
? Why not just the event.error
? Or you could set error.message
to event.message
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree.
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. |
No description provided.