-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add support for plugin config #13
Conversation
Available in Jest 23.3.0, so should be good to go 🙂 |
src/file_name_plugin.js
Outdated
|
||
constructor({ | ||
stdin, | ||
stdout, | ||
config, |
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.
should have a default value
src/file_name_plugin.js
Outdated
@@ -48,8 +57,8 @@ class FileNamePlugin { | |||
// eslint-disable-next-line class-methods-use-this | |||
getUsageInfo() { | |||
return { | |||
key: 'p', | |||
prompt: 'filter by a filename regex pattern', | |||
key: this._config.key || 'p', |
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.
check in constructor and assign there?
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.
Sounds like a good idea? Do you mean assigning the this._key
and this._prompt
as instance variables?
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 🙂
Depends on jestjs/jest#6603