| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
There was a problem hiding this comment.
@cjihrig do we have a way to reproduce an error in coverage collection? I want to snapshot this diagnostic that was missing
Sorry, something went wrong.
There was a problem hiding this comment.
I think the easiest thing would be to monkey patch TestCoverage.prototype.summary() or TestCoverage.prototype.cleanup() so that an error is reported.
Sorry, something went wrong.
There was a problem hiding this comment.
We can also create a dumb loader like ts-node that instead of reading typescript file it will read plain txt and execute them as JS
Sorry, something went wrong.
Not sure if this is relevant but in general we’re trying to avoid encouraging users to ever monkey-patch anything; that’s why the Loaders API / module customization hooks exist, and we plan to extend that model to other systems like FS and REPL. We’ve already added import { register } from 'node:module', the plan is to create import { register } from 'node:fs' and from node:repl and so on. Maybe you might want to create import { register } from 'node:test' to allow users to define customization hooks for various parts of the test runner flow? |
Sorry, something went wrong.
Unless I misunderstood the original question, @MoLow is trying to trigger an error for the purposes of a Node unit test. This is not something end users should ever be doing. |
Sorry, something went wrong.
Excellent, that’s why I wasn’t sure if my comment was relevant. Still though, if/when we need to provide customization abilities for the test runner, like a way to customize output or something, we should consider trying to provide APIs that are somewhat standardized across systems if possible. Maybe that won’t ever be necessary for the test runner since the reporters themselves are so customizable, but I just wanted to bring it up before people started designing new things. |
Sorry, something went wrong.
|
@cjihrig you understood me correctly |
Sorry, something went wrong.
|
@nodejs/test_runner I believe this is ready for reviews |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
Thanks a lot guys! |
Sorry, something went wrong.
PR-URL: nodejs/node#49406 Fixes: nodejs/node#49398 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs/node#49406 Fixes: nodejs/node#49398 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
Fixes: #49398
not sure how to test this, any help appreciated