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:
authornlf <quitlahok@gmail.com>2021-04-06 17:33:52 +0300
committerGar <gar+gh@danger.computer>2021-04-08 20:26:49 +0300
commit1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5 (patch)
tree524624d33388213b4c622fc7d89a260f4dd6b769 /tap-snapshots
parentba4f7fea8fca8e3509469a218f094fe69095888b (diff)
feat(workspaces): implement workspace support for dist-tag
PR-URL: https://github.com/npm/cli/pull/3032 Credit: @nlf Close: #3032 Reviewed-by: @wraithgar
Diffstat (limited to 'tap-snapshots')
-rw-r--r--tap-snapshots/test-lib-dist-tag.js-TAP.test.js112
-rw-r--r--tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js3
2 files changed, 115 insertions, 0 deletions
diff --git a/tap-snapshots/test-lib-dist-tag.js-TAP.test.js b/tap-snapshots/test-lib-dist-tag.js-TAP.test.js
index 06936795b..ea25b568b 100644
--- a/tap-snapshots/test-lib-dist-tag.js-TAP.test.js
+++ b/tap-snapshots/test-lib-dist-tag.js-TAP.test.js
@@ -15,6 +15,9 @@ npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
+Options:
+[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
+
alias: dist-tags
Run "npm help dist-tag" for more info
@@ -30,6 +33,9 @@ npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
+Options:
+[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
+
alias: dist-tags
Run "npm help dist-tag" for more info
@@ -54,6 +60,9 @@ npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
+Options:
+[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
+
alias: dist-tags
Run "npm help dist-tag" for more info
@@ -75,6 +84,9 @@ npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
+Options:
+[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
+
alias: dist-tags
Run "npm help dist-tag" for more info
@@ -126,6 +138,9 @@ npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
+Options:
+[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
+
alias: dist-tags
Run "npm help dist-tag" for more info
@@ -142,3 +157,100 @@ dist-tag add b to @scoped/another@0.6.0
dist-tag add b is already set to version 0.6.0
`
+
+exports[`test/lib/dist-tag.js TAP workspaces no args > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces no args, one failing workspace sets exitCode to 1 > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+workspace-d:
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces no args, one workspace > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces one arg -- . > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces one arg -- .@1, ignores version spec > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces one arg -- list > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces two args -- list, . > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces two args -- list, .@1, ignores version spec > printed the expected output 1`] = `
+workspace-a:
+latest-a: 1.0.0
+latest: 1.0.0
+workspace-b:
+latest-b: 2.0.0
+latest: 2.0.0
+workspace-c:
+latest-c: 3.0.0
+latest: 3.0.0
+`
+
+exports[`test/lib/dist-tag.js TAP workspaces two args -- list, @scoped/pkg, logs a warning and ignores workspaces > printed the expected output 1`] = `
+a: 0.0.1
+b: 0.5.0
+latest: 1.0.0
+`
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 45863cdf4..19beaaa85 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
@@ -323,6 +323,9 @@ All commands:
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
+ Options:
+ [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
+
alias: dist-tags
Run "npm help dist-tag" for more info