unjs / nypm

🌈 Unified Package Manager for Node.js and Bun
MIT License
471 stars 17 forks source link

fix: pass appropriate workspace args and improve tests #90

Closed pi0 closed 1 year ago

pi0 commented 1 year ago

πŸ”— Linked issue

Reported from https://github.com/nuxt/cli/issues/116

❓ Type of change

πŸ“š Description

I had missed this from big PR in https://github.com/unjs/nypm/pull/75

We were only testing installations in workspace mode (and still passing wrong arguments!)

This PR, first splits tests and adds both workspace and non workspace fixtures and tests, completely separated.

Also adds support for workspace?: string|boolean. When true or "" is passed, we assume installing into the workspace root. The string value when nonempty, is the workspace package name (in class of yarn classic, dir!)

πŸ“ Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #90 (61928fa) into main (84357e0) will decrease coverage by 1.44%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
- Coverage   98.07%   96.63%   -1.44%     
==========================================
  Files           5        5              
  Lines         415      416       +1     
  Branches       66       60       -6     
==========================================
- Hits          407      402       -5     
- Misses          8       14       +6     
Files Changed Coverage Ξ”
src/_utils.ts 94.77% <100.00%> (-3.73%) :arrow_down:
src/types.ts 100.00% <100.00%> (ΓΈ)

... and 1 file with indirect coverage changes