aaronpowell / ps-nvm

PowerShell module for managing multiple Node.js versions
MIT License
127 stars 26 forks source link

Install-NodeVersion: take into account .nvmrc & package.json #76

Closed rvdginste closed 5 years ago

rvdginste commented 5 years ago

If no version is given, then scan the current directory for either a .nvmrc file or a package.json file. Behavior is identical to the Set-NodeVersion cmdlet.

aaronpowell commented 5 years ago

Hmm, wonder why the Linux build dies... Weird.

Do you think it'd be possible to add a test to cover this scenario? I wouldn't want the test coverage to drop ;)

rvdginste commented 5 years ago

Sure, I'll give it a go.

The linux build fails because it cannot find the dotnet-sdk-2.0.0 package, even though at first sight, the package still seems to be available. Maybe I'll see if I can run that build locally.

nschonni commented 5 years ago

Fix for the linux build issue over in #77

codecov[bot] commented 5 years ago

Codecov Report

Merging #76 into master will increase coverage by 0.87%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
+ Coverage   88.88%   89.76%   +0.87%     
==========================================
  Files           1        1              
  Lines         117      127      +10     
==========================================
+ Hits          104      114      +10     
  Misses         13       13
Impacted Files Coverage Δ
nvm.psm1 89.76% <100%> (+0.87%) :arrow_up:

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 dfb06f7...a2a4fb4. Read the comment docs.

aaronpowell commented 5 years ago

There we go, we're getting code coverage listed again.

aaronpowell commented 5 years ago

@rvdginste You can mock the Get-Content call here: https://github.com/aaronpowell/ps-nvm/blob/master/nvm.tests.ps1#L167

Then you could just simulate the JSON structure for the different conditional paths.

rvdginste commented 5 years ago

@aaronpowell I added some tests in. I made integration-tests just like the other Install-NodeVersion tests. Is this ok?

aaronpowell commented 5 years ago

Rolling out in release 2.4.0