-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor validatePlugins to throw coded errors #4237
Conversation
f08d590
to
c2f55a2
Compare
@raymondfeng updated |
I think this is pretty non-controversial, but would still like another maintainer to look. |
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.
Can we exclude the HTML reporter for CLI usage?
I'm not sure wether the plugin validation is the correct place for this.
The Right now, w/o |
- add `createInvalidPluginError` for reporters, UIs, and future plugins - ensures the original error is output if the module exists, but it throws (see `test/node-unit/cli/fixtures/bad-module.fixture.js`) - remove unneeded `process.cwd()` from call to `path.resolve()` Ref: #4198
c2f55a2
to
74e9c4d
Compare
Updated to resolve peer review issues |
exports.validatePlugin = (opts, pluginType, map = {}) => { | ||
/** | ||
* This should be a unique identifier; either a string (present in `map`), | ||
* or a resolvable (via `require.resolve`) module ID/path. |
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.
(Then we will have the same ESM / async problematic here.)
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.
true, might as well make this async too.
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.
I think that's another PR though.
createInvalidPluginError
for reporters, UIs, and future pluginstest/node-unit/cli/fixtures/bad-module.fixture.js
)process.cwd()
from call topath.resolve()
Ref: #4198