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

Can Jest use npm_lifecycle_script to determine the update command? #4440

Closed
adityavohra7 opened this issue Sep 7, 2017 · 4 comments · Fixed by #4629
Closed

Can Jest use npm_lifecycle_script to determine the update command? #4440

adityavohra7 opened this issue Sep 7, 2017 · 4 comments · Fixed by #4629

Comments

@adityavohra7
Copy link

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

What is the current behavior?
Jest uses process.env.npm_lifecycle_event to determine what the command to update snapshots should be. It feels like Jest is assuming that the lifecycle script invokes Jest directly?

What is the expected behavior?
Could Jest use process.env.npm_lifecycle_script to confirm that the lifecycle script invokes Jest directly. If it does, keep the current behavior, if it doesn't, try to guess a better update command? The motivation is a use case wherein people are wrapping the Jest invocation in some script.

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

$ ./node_modules/.bin/jest --version
v20.0.4

$ node --version
v8.4.0

$ npm --version
5.3.0

$ uname -a
Linux dev9-uswest1cdevc 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
@cpojer
Copy link
Member

cpojer commented Sep 7, 2017

You can try sending a PR for that :)

@adityavohra7
Copy link
Author

Sure! I'll give it a shot 😊

I'll try to get this PR merged first 😀

@thymikee
Copy link
Collaborator

This also needs to be updated: #4468

@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