Skip to content
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

Allow jest-validate to print deprecation warnings for CLI flags #5522

Closed
SimenB opened this issue Feb 11, 2018 · 8 comments · Fixed by #5536
Closed

Allow jest-validate to print deprecation warnings for CLI flags #5522

SimenB opened this issue Feb 11, 2018 · 8 comments · Fixed by #5536

Comments

@SimenB
Copy link
Member

SimenB commented Feb 11, 2018

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
When jest-validate was created in #2524, it came with support for printing deprecation warnings in configuration.

If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.

N/A

What is the expected behavior?
It would be great if we could also print deprecation warnings for CLI flags in the same way. Currently unknown flags throws (which makes sense to catch typos), but it would be great to alert users of removed (or altered) options in a semver-compliant way.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

Jest@master

@Aftabnack
Copy link
Contributor

Is this taken? Can I work on this?

@thymikee
Copy link
Collaborator

@Aftabnack not taken :)

@Aftabnack
Copy link
Contributor

It's mine then. 😉

@Aftabnack
Copy link
Contributor

https://github.com/facebook/jest/blob/55c342af240a8aa1acb487a253a6ade4a8a4f4a1/packages/jest-cli/src/cli/args.js#L306-L312

  • I am planning to add two more attributes to this here, called isDeprecated (boolean) & deprecationMessage (string)
  • I will have a generic template which will print all the deprecation warnings. Avoids the need to have a jest-config/src/deprecated.js with functions to warn on specific attributes.

And also, I am assuming that the above file contains the master list of all the options that can be configured.

/cc @SimenB @thymikee
Thoughts?

@SimenB
Copy link
Member Author

SimenB commented Feb 12, 2018

I think that makes sense! 🙂 @thymikee knows this part of the code better than me, though

@Aftabnack
Copy link
Contributor

Also, we don't merge CLI flags with the config.js options. Is this intended? If we don't merge, then deprecation warnings may end up twice. Is this OK?

IMO, we should have CLI flags override it's values specified in the config.

@SimenB
Copy link
Member Author

SimenB commented Feb 12, 2018

I agree. Separate issue, though

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants