Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-03-31 01:37:48 +0300
committerGar <gar+gh@danger.computer>2021-04-01 00:02:08 +0300
commit32717a60eb55fcf8c7e5016223bfee78a6daba0e (patch)
treed16c57e3c80280a3d971d3cbf1ff7b9099c10015 /tap-snapshots
parentec520ce32d5e834a32ebd58491df4200e01ce690 (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.js3
-rw-r--r--tap-snapshots/test-lib-view.js-TAP.test.js257
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 a year ago
`
+
+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`] = `
+
+
+green@1.0.0 | ACME | deps: 2 | versions: 2
+green is a very important color
+
+DEPRECATED!! - true
+
+keywords:colors, green, crayola
+
+bin:green
+
+dist
+.tarball:http://hm.green.com/1.0.0.tgz
+.shasum:123
+.integrity:---
+.unpackedSize:1 B
+
+dependencies:
+red: 1.0.0
+yellow: 1.0.0
+
+maintainers:
+-claudia <c@yellow.com>
+-isaacs <i@yellow.com>
+
+dist-tags:
+latest: 1.0.0
+
+orange@1.0.0 | Proprietary | deps: none | versions: 2
+http://hm.orange.com
+
+dist
+.tarball:http://hm.orange.com/1.0.0.tgz
+.shasum:123
+.integrity:---
+.unpackedSize:1 B
+
+dist-tags:
+latest: 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`] = `
+
+
+green@1.0.0 | ACME | deps: 2 | versions: 2
+green is a very important color
+
+DEPRECATED!! - true
+
+keywords:colors, green, crayola
+
+bin:green
+
+dist
+.tarball:http://hm.green.com/1.0.0.tgz
+.shasum:123
+.integrity:---
+.unpackedSize:1 B
+
+dependencies:
+red: 1.0.0
+yellow: 1.0.0
+
+maintainers:
+-claudia <c@yellow.com>
+-isaacs <i@yellow.com>
+
+dist-tags:
+latest: 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`] = `
+
+
+pink@1.0.0 | Proprietary | deps: none | versions: 2
+
+dist
+.tarball:http://hm.pink.com/1.0.0.tgz
+.shasum:123
+.integrity:---
+.unpackedSize:1 B
+
+dist-tags:
+latest: 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
+ }
+ }
+}
+`