diff options
author | Gar <gar+gh@danger.computer> | 2021-03-31 01:37:48 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-04-01 00:02:08 +0300 |
commit | 32717a60eb55fcf8c7e5016223bfee78a6daba0e (patch) | |
tree | d16c57e3c80280a3d971d3cbf1ff7b9099c10015 /tap-snapshots | |
parent | ec520ce32d5e834a32ebd58491df4200e01ce690 (diff) |
feat(view): add workspace support
PR-URL: https://github.com/npm/cli/pull/3001
Credit: @wraithgar
Close: #3001
Reviewed-by: @nlf
Diffstat (limited to 'tap-snapshots')
-rw-r--r-- | tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js | 3 | ||||
-rw-r--r-- | tap-snapshots/test-lib-view.js-TAP.test.js | 257 |
2 files changed, 260 insertions, 0 deletions
diff --git a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js index 4f9c1b44e..66d274057 100644 --- a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js @@ -920,6 +920,9 @@ All commands: Usage: npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...] + Options: + [--json] [-w|--workspace <workspace>|-w|--workspace <workspace>] [-ws|--workspaces] + aliases: v, info, show Run "npm help view" for more info diff --git a/tap-snapshots/test-lib-view.js-TAP.test.js b/tap-snapshots/test-lib-view.js-TAP.test.js index f8a9fe464..02810e31a 100644 --- a/tap-snapshots/test-lib-view.js-TAP.test.js +++ b/tap-snapshots/test-lib-view.js-TAP.test.js @@ -270,3 +270,260 @@ dist-tags: published [33ma year ago[39m ` + +exports[`test/lib/view.js TAP workspaces all workspaces --json > must match snapshot 1`] = ` + +{ + "green": { + "_id": "green", + "name": "green", + "dist-tags": { + "latest": "1.0.0" + }, + "maintainers": [ + { + "name": "claudia", + "email": "c@yellow.com", + "twitter": "cyellow" + }, + { + "name": "isaacs", + "email": "i@yellow.com", + "twitter": "iyellow" + } + ], + "keywords": [ + "colors", + "green", + "crayola" + ], + "versions": [ + "1.0.0", + "1.0.1" + ], + "version": "1.0.0", + "description": "green is a very important color", + "bugs": { + "url": "http://bugs.green.com" + }, + "deprecated": true, + "repository": { + "url": "http://repository.green.com" + }, + "license": { + "type": "ACME" + }, + "bin": { + "green": "bin/green.js" + }, + "dependencies": { + "red": "1.0.0", + "yellow": "1.0.0" + }, + "dist": { + "shasum": "123", + "tarball": "http://hm.green.com/1.0.0.tgz", + "integrity": "---", + "fileCount": 1, + "unpackedSize": 1 + } + }, + "orange": { + "name": "orange", + "dist-tags": { + "latest": "1.0.0" + }, + "versions": [ + "1.0.0", + "1.0.1" + ], + "version": "1.0.0", + "homepage": "http://hm.orange.com", + "license": {}, + "dist": { + "shasum": "123", + "tarball": "http://hm.orange.com/1.0.0.tgz", + "integrity": "---", + "fileCount": 1, + "unpackedSize": 1 + } + } +} +` + +exports[`test/lib/view.js TAP workspaces all workspaces > must match snapshot 1`] = ` + + +[4m[1m[32mgreen[39m@[32m1.0.0[39m[22m[24m | [32mACME[39m | deps: [36m2[39m | versions: [33m2[39m +green is a very important color + +[1m[31mDEPRECATED[39m[22m!! - true + +keywords:[33mcolors[39m, [33mgreen[39m, [33mcrayola[39m + +bin:[33mgreen[39m + +dist +.tarball:[36mhttp://hm.green.com/1.0.0.tgz[39m +.shasum:[33m123[39m +.integrity:[33m---[39m +.unpackedSize:[33m1[39m B + +dependencies: +[33mred[39m: 1.0.0 +[33myellow[39m: 1.0.0 + +maintainers: +-[33mclaudia[39m <[36mc@yellow.com[39m> +-[33misaacs[39m <[36mi@yellow.com[39m> + +dist-tags: +[1m[32mlatest[39m[22m: 1.0.0 + +[4m[1m[32morange[39m@[32m1.0.0[39m[22m[24m | [1m[31mProprietary[39m[22m | deps: [32mnone[39m | versions: [33m2[39m +[36mhttp://hm.orange.com[39m + +dist +.tarball:[36mhttp://hm.orange.com/1.0.0.tgz[39m +.shasum:[33m123[39m +.integrity:[33m---[39m +.unpackedSize:[33m1[39m B + +dist-tags: +[1m[32mlatest[39m[22m: 1.0.0 +` + +exports[`test/lib/view.js TAP workspaces all workspaces nonexistent field --json > must match snapshot 1`] = ` + +` + +exports[`test/lib/view.js TAP workspaces all workspaces nonexistent field > must match snapshot 1`] = ` + +green: +orange: +` + +exports[`test/lib/view.js TAP workspaces all workspaces single field --json > must match snapshot 1`] = ` + +{ + "green": "green", + "orange": "orange" +} +` + +exports[`test/lib/view.js TAP workspaces all workspaces single field > must match snapshot 1`] = ` + +green: +green +orange: +orange +` + +exports[`test/lib/view.js TAP workspaces one specific workspace > must match snapshot 1`] = ` + + +[4m[1m[32mgreen[39m@[32m1.0.0[39m[22m[24m | [32mACME[39m | deps: [36m2[39m | versions: [33m2[39m +green is a very important color + +[1m[31mDEPRECATED[39m[22m!! - true + +keywords:[33mcolors[39m, [33mgreen[39m, [33mcrayola[39m + +bin:[33mgreen[39m + +dist +.tarball:[36mhttp://hm.green.com/1.0.0.tgz[39m +.shasum:[33m123[39m +.integrity:[33m---[39m +.unpackedSize:[33m1[39m B + +dependencies: +[33mred[39m: 1.0.0 +[33myellow[39m: 1.0.0 + +maintainers: +-[33mclaudia[39m <[36mc@yellow.com[39m> +-[33misaacs[39m <[36mi@yellow.com[39m> + +dist-tags: +[1m[32mlatest[39m[22m: 1.0.0 +` + +exports[`test/lib/view.js TAP workspaces remote package name > must match snapshot 1`] = ` +Ignoring workspaces for remote package +` + +exports[`test/lib/view.js TAP workspaces remote package name > must match snapshot 2`] = ` + + +[4m[1m[32mpink[39m@[32m1.0.0[39m[22m[24m | [1m[31mProprietary[39m[22m | deps: [32mnone[39m | versions: [33m2[39m + +dist +.tarball:[36mhttp://hm.pink.com/1.0.0.tgz[39m +.shasum:[33m123[39m +.integrity:[33m---[39m +.unpackedSize:[33m1[39m B + +dist-tags: +[1m[32mlatest[39m[22m: 1.0.0 +` + +exports[`test/lib/view.js TAP workspaces single workspace --json > must match snapshot 1`] = ` + +{ + "green": { + "_id": "green", + "name": "green", + "dist-tags": { + "latest": "1.0.0" + }, + "maintainers": [ + { + "name": "claudia", + "email": "c@yellow.com", + "twitter": "cyellow" + }, + { + "name": "isaacs", + "email": "i@yellow.com", + "twitter": "iyellow" + } + ], + "keywords": [ + "colors", + "green", + "crayola" + ], + "versions": [ + "1.0.0", + "1.0.1" + ], + "version": "1.0.0", + "description": "green is a very important color", + "bugs": { + "url": "http://bugs.green.com" + }, + "deprecated": true, + "repository": { + "url": "http://repository.green.com" + }, + "license": { + "type": "ACME" + }, + "bin": { + "green": "bin/green.js" + }, + "dependencies": { + "red": "1.0.0", + "yellow": "1.0.0" + }, + "dist": { + "shasum": "123", + "tarball": "http://hm.green.com/1.0.0.tgz", + "integrity": "---", + "fileCount": 1, + "unpackedSize": 1 + } + } +} +` |