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

dist-tag.js.test.cjs « lib « test « tap-snapshots - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 86a9c84eb1eb63dfcdd589434a61b7a30b9654b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
/* IMPORTANT
 * This snapshot file is auto-generated, but designed for humans.
 * It should be checked into source control and tracked carefully.
 * Re-generate by setting TAP_SNAPSHOT=1 and running tests.
 * Make sure to inspect the output below.  Do not ignore changes!
 */
'use strict'
exports[`test/lib/dist-tag.js TAP add missing args > should exit usage error message 1`] = `
npm dist-tag

Modify package distribution tags

Usage:
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
`

exports[`test/lib/dist-tag.js TAP add missing pkg name > should exit usage error message 1`] = `
npm dist-tag

Modify package distribution tags

Usage:
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
`

exports[`test/lib/dist-tag.js TAP add new tag > should return success msg 1`] = `
+c: @scoped/another@7.7.7
`

exports[`test/lib/dist-tag.js TAP add using valid semver range as name > should return success msg 1`] = `
dist-tag add 1.0.0 to @scoped/another@7.7.7 

`

exports[`test/lib/dist-tag.js TAP borked cmd usage > should show usage error 1`] = `
npm dist-tag

Modify package distribution tags

Usage:
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
`

exports[`test/lib/dist-tag.js TAP ls in current package > should list available tags for current package 1`] = `
a: 0.0.1
b: 0.5.0
latest: 1.0.0
`

exports[`test/lib/dist-tag.js TAP ls on missing name in current package > should throw usage error message 1`] = `
npm dist-tag

Modify package distribution tags

Usage:
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
`

exports[`test/lib/dist-tag.js TAP ls on missing package > should log no dist-tag found msg 1`] = `
dist-tag ls Couldn't get dist-tag data for foo@latest 

`

exports[`test/lib/dist-tag.js TAP ls on missing package > should throw error message 1`] = `
Error: No dist-tags found for foo
`

exports[`test/lib/dist-tag.js TAP ls on named package > should list tags for the specified package 1`] = `
a: 0.0.2
b: 0.6.0
latest: 2.0.0
`

exports[`test/lib/dist-tag.js TAP no args in current package > should default to listing available tags for current package 1`] = `
a: 0.0.1
b: 0.5.0
latest: 1.0.0
`

exports[`test/lib/dist-tag.js TAP only named package arg > should default to listing tags for the specified package 1`] = `
a: 0.0.2
b: 0.6.0
latest: 2.0.0
`

exports[`test/lib/dist-tag.js TAP remove existing tag > should log remove info 1`] = `
dist-tag del c from @scoped/another 

`

exports[`test/lib/dist-tag.js TAP remove existing tag > should return success msg 1`] = `
-c: @scoped/another@7.7.7
`

exports[`test/lib/dist-tag.js TAP remove missing pkg name > should exit usage error message 1`] = `
npm dist-tag

Modify package distribution tags

Usage:
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
`

exports[`test/lib/dist-tag.js TAP remove non-existing tag > should log error msg 1`] = `
dist-tag del nonexistent from @scoped/another 
dist-tag del nonexistent is not a dist-tag on @scoped/another 

`

exports[`test/lib/dist-tag.js TAP set existing version > should log warn msg 1`] = `
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
`