-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoutdated.js.test.cjs
299 lines (270 loc) · 12.4 KB
/
outdated.js.test.cjs
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/* 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/commands/outdated.js TAP aliases > should display aliased outdated dep output 1`] = `
Package Current Wanted Latest Location Depended by
cat:dog@latest 1.0.0 2.0.0 2.0.0 node_modules/cat prefix
`
exports[`test/lib/commands/outdated.js TAP aliases with version range > should display aliased outdated dep output with correct wanted values 1`] = `
Package Current Wanted Latest Location Depended by
cat:dog@^1.0.0 1.0.0 1.0.1 2.0.0 node_modules/cat prefix
`
exports[`test/lib/commands/outdated.js TAP dependent location --long --json > should display dependent location when using --long and --json 1`] = `
{
"dog": [
{
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "2.0.0",
"dependent": "a",
"location": "{CWD}/prefix/node_modules/dog",
"type": "dependencies",
"dependedByLocation": "a"
},
{
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "2.0.0",
"dependent": "a",
"location": "{CWD}/prefix/node_modules/dog",
"type": "dependencies",
"dependedByLocation": "nest/a"
}
]
}
`
exports[`test/lib/commands/outdated.js TAP dependent location --long > should display dependent location when using --long 1`] = `
Package Current Wanted Latest Location Depended by Package Type Homepage Depended By Location
dog 1.0.0 1.0.1 2.0.0 node_modules/dog a@1.0.0 dependencies a
dog 1.0.0 1.0.1 2.0.0 node_modules/dog a@npm:nest-a@1.0.0 dependencies nest/a
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --all > must match snapshot 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat prefix
chai 1.0.0 1.0.1 1.0.1 node_modules/chai prefix
dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix
theta MISSING 1.0.1 1.0.1 - prefix
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --json --long > must match snapshot 1`] = `
{
"cat": {
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/cat",
"type": "dependencies",
"dependedByLocation": ""
},
"chai": {
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/chai",
"type": "peerDependencies",
"dependedByLocation": ""
},
"dog": {
"current": "1.0.1",
"wanted": "1.0.1",
"latest": "2.0.0",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/dog",
"type": "dependencies",
"dependedByLocation": ""
},
"theta": {
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "prefix",
"type": "dependencies",
"dependedByLocation": ""
}
}
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --json > must match snapshot 1`] = `
{
"cat": {
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/cat"
},
"chai": {
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/chai"
},
"dog": {
"current": "1.0.1",
"wanted": "1.0.1",
"latest": "2.0.0",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/dog"
},
"theta": {
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "prefix"
}
}
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --long > must match snapshot 1`] = `
Package Current Wanted Latest Location Depended by Package Type Homepage Depended By Location
cat 1.0.0 1.0.1 1.0.1 node_modules/cat prefix dependencies
chai 1.0.0 1.0.1 1.0.1 node_modules/chai prefix peerDependencies
dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix dependencies
theta MISSING 1.0.1 1.0.1 - prefix dependencies
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --omit=dev --omit=peer > must match snapshot 1`] = `
[1m[4mPackage[24m[22m [1m[4mCurrent[24m[22m [1m[4mWanted[24m[22m [1m[4mLatest[24m[22m [1m[4mLocation[24m[22m [1m[4mDepended by[24m[22m
[31mcat[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/cat prefix
[33mdog[39m 1.0.1 [36m1.0.1[39m [34m2.0.0[39m node_modules/dog prefix
[31mtheta[39m MISSING [36m1.0.1[39m [34m1.0.1[39m - prefix
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --omit=dev > must match snapshot 1`] = `
[1m[4mPackage[24m[22m [1m[4mCurrent[24m[22m [1m[4mWanted[24m[22m [1m[4mLatest[24m[22m [1m[4mLocation[24m[22m [1m[4mDepended by[24m[22m
[31mcat[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/cat prefix
[31mchai[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/chai prefix
[33mdog[39m 1.0.1 [36m1.0.1[39m [34m2.0.0[39m node_modules/dog prefix
[31mtheta[39m MISSING [36m1.0.1[39m [34m1.0.1[39m - prefix
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --omit=prod > must match snapshot 1`] = `
[1m[4mPackage[24m[22m [1m[4mCurrent[24m[22m [1m[4mWanted[24m[22m [1m[4mLatest[24m[22m [1m[4mLocation[24m[22m [1m[4mDepended by[24m[22m
[31mcat[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/cat prefix
[31mchai[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/chai prefix
[33mdog[39m 1.0.1 [36m1.0.1[39m [34m2.0.0[39m node_modules/dog prefix
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --parseable --long > must match snapshot 1`] = `
{CWD}/prefix/node_modules/cat:cat@1.0.1:cat@1.0.0:cat@1.0.1:prefix:dependencies::
{CWD}/prefix/node_modules/chai:chai@1.0.1:chai@1.0.0:chai@1.0.1:prefix:peerDependencies::
{CWD}/prefix/node_modules/dog:dog@1.0.1:dog@1.0.1:dog@2.0.0:prefix:dependencies::
:theta@1.0.1:MISSING:theta@1.0.1:prefix:dependencies::
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --parseable > must match snapshot 1`] = `
{CWD}/prefix/node_modules/cat:cat@1.0.1:cat@1.0.0:cat@1.0.1:prefix
{CWD}/prefix/node_modules/chai:chai@1.0.1:chai@1.0.0:chai@1.0.1:prefix
{CWD}/prefix/node_modules/dog:dog@1.0.1:dog@1.0.1:dog@2.0.0:prefix
:theta@1.0.1:MISSING:theta@1.0.1:prefix
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated > must match snapshot 1`] = `
[1m[4mPackage[24m[22m [1m[4mCurrent[24m[22m [1m[4mWanted[24m[22m [1m[4mLatest[24m[22m [1m[4mLocation[24m[22m [1m[4mDepended by[24m[22m
[31mcat[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/cat prefix
[31mchai[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/chai prefix
[33mdog[39m 1.0.1 [36m1.0.1[39m [34m2.0.0[39m node_modules/dog prefix
[31mtheta[39m MISSING [36m1.0.1[39m [34m1.0.1[39m - prefix
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated global > must match snapshot 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat global
`
exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated specific dep > must match snapshot 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat prefix
`
exports[`test/lib/commands/outdated.js TAP workspaces should display all dependencies > output 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0
chai 1.0.0 1.0.1 1.0.1 node_modules/chai foo
dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix
theta MISSING 1.0.1 1.0.1 - c@1.0.0
theta MISSING 1.0.1 1.0.1 - d@1.0.0
theta MISSING 1.0.1 1.0.1 - e@1.0.0
`
exports[`test/lib/commands/outdated.js TAP workspaces should display json results filtered by ws > output 1`] = `
{
"cat": {
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "a",
"location": "{CWD}/prefix/node_modules/cat"
}
}
`
exports[`test/lib/commands/outdated.js TAP workspaces should display missing deps when filtering by ws > output 1`] = `
Package Current Wanted Latest Location Depended by
theta MISSING 1.0.1 1.0.1 - c@1.0.0
`
exports[`test/lib/commands/outdated.js TAP workspaces should display nested deps when filtering by ws and using --all > output 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0
chai 1.0.0 1.0.1 1.0.1 node_modules/chai foo
`
exports[`test/lib/commands/outdated.js TAP workspaces should display no results if ws has no deps to display > output 1`] = `
`
exports[`test/lib/commands/outdated.js TAP workspaces should display only root outdated when ws disabled > output 1`] = `
`
exports[`test/lib/commands/outdated.js TAP workspaces should display parseable results filtered by ws > output 1`] = `
{CWD}/prefix/node_modules/cat:cat@1.0.1:cat@1.0.0:cat@1.0.1:a
`
exports[`test/lib/commands/outdated.js TAP workspaces should display results filtered by ws > output 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0
`
exports[`test/lib/commands/outdated.js TAP workspaces should display ws outdated deps human output > output 1`] = `
Package Current Wanted Latest Location Depended by
cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0
dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix
theta MISSING 1.0.1 1.0.1 - c@1.0.0
theta MISSING 1.0.1 1.0.1 - d@1.0.0
theta MISSING 1.0.1 1.0.1 - e@1.0.0
`
exports[`test/lib/commands/outdated.js TAP workspaces should display ws outdated deps json output > output 1`] = `
{
"cat": {
"current": "1.0.0",
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "a",
"location": "{CWD}/prefix/node_modules/cat"
},
"dog": {
"current": "1.0.1",
"wanted": "1.0.1",
"latest": "2.0.0",
"dependent": "prefix",
"location": "{CWD}/prefix/node_modules/dog"
},
"theta": [
{
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "c"
},
{
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "d"
},
{
"wanted": "1.0.1",
"latest": "1.0.1",
"dependent": "e"
}
]
}
`
exports[`test/lib/commands/outdated.js TAP workspaces should display ws outdated deps parseable output > output 1`] = `
{CWD}/prefix/node_modules/cat:cat@1.0.1:cat@1.0.0:cat@1.0.1:a
{CWD}/prefix/node_modules/dog:dog@1.0.1:dog@1.0.1:dog@2.0.0:prefix
:theta@1.0.1:MISSING:theta@1.0.1:c
:theta@1.0.1:MISSING:theta@1.0.1:d
:theta@1.0.1:MISSING:theta@1.0.1:e
`
exports[`test/lib/commands/outdated.js TAP workspaces should highlight ws in dependend by section > output 1`] = `
[1m[4mPackage[24m[22m [1m[4mCurrent[24m[22m [1m[4mWanted[24m[22m [1m[4mLatest[24m[22m [1m[4mLocation[24m[22m [1m[4mDepended by[24m[22m
[31mcat[39m 1.0.0 [36m1.0.1[39m [34m1.0.1[39m node_modules/cat [34ma@1.0.0[39m
[33mdog[39m 1.0.1 [36m1.0.1[39m [34m2.0.0[39m node_modules/dog prefix
[31mtheta[39m MISSING [36m1.0.1[39m [34m1.0.1[39m - [34mc@1.0.0[39m
[31mtheta[39m MISSING [36m1.0.1[39m [34m1.0.1[39m - [34md@1.0.0[39m
[31mtheta[39m MISSING [36m1.0.1[39m [34m1.0.1[39m - [34me@1.0.0[39m
`