diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2021-05-20 00:57:39 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2021-05-20 19:15:00 +0300 |
commit | 41099d3958d08f166313b7eb69b76458f8f9224c (patch) | |
tree | c4c099cad91412d3988464849fd02bec696b95e6 /tap-snapshots | |
parent | ec256a14aa6eb2bd59fd55dcc6a4bc0148662c4e (diff) |
feat(explain): add workspaces support
- Add highlight style for workspaces items in human output
- Add ability to filter results by workspace using `-w` config
- Added tests and docs
Fixes: https://github.com/npm/statusboard/issues/300
PR-URL: https://github.com/npm/cli/pull/3265
Credit: @ruyadorno
Close: #3265
Reviewed-by: @isaacs
Diffstat (limited to 'tap-snapshots')
-rw-r--r-- | tap-snapshots/test/lib/utils/explain-dep.js.test.cjs | 26 | ||||
-rw-r--r-- | tap-snapshots/test/lib/utils/npm-usage.js.test.cjs | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs b/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs index 7e77081f9..4d6f4686d 100644 --- a/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs +++ b/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs @@ -199,3 +199,29 @@ exports[`test/lib/utils/explain-dep.js TAP prodDep > print nocolor 1`] = ` prod-dep@1.2.3 node_modules/prod-dep ` + +exports[`test/lib/utils/explain-dep.js TAP workspaces > explain color deep 1`] = ` +[32ma@1.0.0[39m[2m[22m +[2ma[22m + [32ma@1.0.0[39m[2m[22m + [2mnode_modules/a[22m + [32mworkspace[39m [1ma[22m from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP workspaces > explain nocolor shallow 1`] = ` +a@1.0.0 +a + a@1.0.0 + node_modules/a + workspace a from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP workspaces > print color 1`] = ` +[32ma@1.0.0[39m[2m[22m +[2ma[22m +` + +exports[`test/lib/utils/explain-dep.js TAP workspaces > print nocolor 1`] = ` +a@1.0.0 +a +` diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index 661deec26..585fc7e8b 100644 --- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -430,7 +430,7 @@ All commands: npm explain <folder | specifier> Options: - [--json] + [--json] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] alias: why |