-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
[Tests] add tests for "make 'nvm use' display '.nvmrc' version" #1258
base: master
Are you sure you want to change the base?
[Tests] add tests for "make 'nvm use' display '.nvmrc' version" #1258
Conversation
Set $PROVIDED_VERSION equals to $NVM_RC_VERSION only if a .nvmrc file is present and the user didn't provided a version to use (.ie typed `nvm use`). - Behavior before this fix : nvm use Found '.nvmrc' with version <v0.10.28> N/A: version "N/A" is not yet installed. You need to run "nvm install N/A" to install it before using it. - Behavior after this fix : nvm use Found '.nvmrc' with version <v0.10.28> N/A: version "v0.10.28" is not yet installed. You need to run "nvm install v0.10.28" to install it before using it.
15099cd
to
662735c
Compare
662735c
to
8a08df3
Compare
@@ -0,0 +1,18 @@ | |||
#!/bin/sh |
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.
this filename seems to start with a leading space - can you remove it?
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.
Also, can you add set -e
- either here, or after the line that sources nvm.sh
, if the tests fail when it's 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.
Fixed it!
EDIT: Also fix to chmod a+x
ed14e79
to
3865e3f
Compare
Hm looks like my tests are failing. I will look into this |
61db95d
to
93a587c
Compare
93a587c
to
18a7190
Compare
@jumbosushi have you had a chance to look into this? |
Is this issue still needs to be opened ? My original one was resolved with new releases of nvm that might be the case for this one as well no ? |
18a7190
to
0235dc8
Compare
The tests are still useful, even if the implementation change isn't. |
ee9716e
to
2f7b7d2
Compare
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.
will land if the test passes
2f7b7d2
to
27dea68
Compare
Tests failed; i restored the fix from #1187 to see if that makes them pass. |
@jumbosushi unfortunately the test fails with or without the fix. |
c6cfc3a
to
c20db2a
Compare
Addition of tests was asked by @ljharb for the pull request #1187 started by @anchnk, which was to display the versions of .nvmrc when "nvm use" is called.
This PR is a continuation of #1187 to add tests.
Let me know if anything needs to be changed!
EDIT: Added .nvmrc setup and cleanup in setup_dir and teardown_dir
EDIT2: Better error message