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

print version ending in -dev when running a local Jest clone #7582

Merged
merged 1 commit into from
Jan 6, 2019

Conversation

jeysal
Copy link
Contributor

@jeysal jeysal commented Jan 5, 2019

Summary

#7562 (cc @SimenB) used __dirname.includes('packages/jest-cli') to determine whether Jest is running from a local clone of the Jest project (as opposed to a regular node_modules installation). We found a cleaner solution than the includes there, but this gave me an idea for something else that could use this information: Indicating that Jest is running from a local clone when called with --version.
I often yarn link Jest into 10+ projects and probably do not always remember to unlink it afterwards. So if Jest behaves strangely, yarn jest --version telling me that it might be because I'm unintentionally running the local Jest clone would be nice (and more cross-platform than realpath node_modules/jest-cli/)

Test plan

TODO how can we e2e test that it does NOT print -dev in a production version of Jest?

@codecov-io
Copy link

Codecov Report

Merging #7582 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #7582      +/-   ##
=========================================
+ Coverage   67.99%     68%   +0.01%     
=========================================
  Files         248     248              
  Lines        9490    9490              
  Branches        6       5       -1     
=========================================
+ Hits         6453    6454       +1     
+ Misses       3035    3034       -1     
  Partials        2       2
Impacted Files Coverage Δ
packages/jest-cli/src/jest.js 100% <0%> (+100%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2ffe3d...55f06ad. Read the comment docs.

@thymikee
Copy link
Collaborator

thymikee commented Jan 6, 2019

how can we e2e test that it does NOT print -dev in a production version of Jest?

Good question. I don't think we have a way of doing this, since we'd need to publish every PR to some registry and download Jest from it?

@SimenB SimenB merged commit adb43c1 into jestjs:master Jan 6, 2019
@jeysal
Copy link
Contributor Author

jeysal commented Jan 6, 2019

I mean, you could probably do something with npm pack, but it'd still need to be a quite complex test setup that might not be worth the effort for the assurance we would get.

captain-yossarian pushed a commit to captain-yossarian/jest that referenced this pull request Jul 18, 2019
@github-actions
Copy link

This pull request 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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants