@modernpoacher/deps 2.0.0-beta.1 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/.depsrc +0 -6
- package/test/common/git/index.spec.mjs +0 -76
- package/test/common/index.spec.mjs +0 -384
- package/test/index.spec.mjs +0 -484
- package/test/install/index.spec.mjs +0 -214
package/package.json
CHANGED
package/.depsrc
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import debug from 'debug'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
expect
|
|
5
|
-
} from 'chai'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
gitRevParse,
|
|
9
|
-
gitCheckout,
|
|
10
|
-
gitPull,
|
|
11
|
-
gitPush,
|
|
12
|
-
gitPushTags,
|
|
13
|
-
gitAdd,
|
|
14
|
-
gitCommit
|
|
15
|
-
} from '#deps/src/common/git'
|
|
16
|
-
|
|
17
|
-
describe('#deps/src/common/git', () => {
|
|
18
|
-
before(() => {
|
|
19
|
-
const {
|
|
20
|
-
env: {
|
|
21
|
-
DEBUG
|
|
22
|
-
}
|
|
23
|
-
} = process
|
|
24
|
-
|
|
25
|
-
if (DEBUG) debug.enable(DEBUG)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
describe('`gitRevParse`', () => {
|
|
29
|
-
it('is a function', () => {
|
|
30
|
-
return expect(gitRevParse)
|
|
31
|
-
.to.be.a('function')
|
|
32
|
-
})
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
describe('`gitCheckout`', () => {
|
|
36
|
-
it('is a function', () => {
|
|
37
|
-
return expect(gitCheckout)
|
|
38
|
-
.to.be.a('function')
|
|
39
|
-
})
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
describe('`gitPull`', () => {
|
|
43
|
-
it('is a function', () => {
|
|
44
|
-
return expect(gitPull)
|
|
45
|
-
.to.be.a('function')
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
describe('`gitPush`', () => {
|
|
50
|
-
it('is a function', () => {
|
|
51
|
-
return expect(gitPush)
|
|
52
|
-
.to.be.a('function')
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
describe('`gitPushTags`', () => {
|
|
57
|
-
it('is a function', () => {
|
|
58
|
-
return expect(gitPushTags)
|
|
59
|
-
.to.be.a('function')
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
describe('`gitAdd`', () => {
|
|
64
|
-
it('is a function', () => {
|
|
65
|
-
return expect(gitAdd)
|
|
66
|
-
.to.be.a('function')
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
describe('`gitCommit`', () => {
|
|
71
|
-
it('is a function', () => {
|
|
72
|
-
return expect(gitCommit)
|
|
73
|
-
.to.be.a('function')
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
})
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import debug from 'debug'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
expect
|
|
5
|
-
} from 'chai'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
getSaveProdParameter,
|
|
9
|
-
getSaveDevParameter,
|
|
10
|
-
getSaveOptionalParameter,
|
|
11
|
-
getSaveBundleParameter,
|
|
12
|
-
getRegistryParameter,
|
|
13
|
-
getNoSaveParameter,
|
|
14
|
-
getSaveExactParameter,
|
|
15
|
-
getCommands,
|
|
16
|
-
isExact,
|
|
17
|
-
getDepsExact,
|
|
18
|
-
getDeps,
|
|
19
|
-
normalizeCommands,
|
|
20
|
-
transformDependency,
|
|
21
|
-
transform,
|
|
22
|
-
getProdDependencies,
|
|
23
|
-
getDevDependencies,
|
|
24
|
-
getOptionalDependencies,
|
|
25
|
-
getBundleDependencies,
|
|
26
|
-
getPeerDependencies
|
|
27
|
-
} from '#deps/src/common'
|
|
28
|
-
|
|
29
|
-
describe('#deps/src/common', () => {
|
|
30
|
-
before(() => {
|
|
31
|
-
const {
|
|
32
|
-
env: {
|
|
33
|
-
DEBUG
|
|
34
|
-
}
|
|
35
|
-
} = process
|
|
36
|
-
|
|
37
|
-
if (DEBUG) debug.enable(DEBUG)
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
describe('`getSaveProdParameter`', () => {
|
|
41
|
-
it('is a function', () => {
|
|
42
|
-
return expect(getSaveProdParameter)
|
|
43
|
-
.to.be.a('function')
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
describe('`getSaveDevParameter`', () => {
|
|
48
|
-
it('is a function', () => {
|
|
49
|
-
return expect(getSaveDevParameter)
|
|
50
|
-
.to.be.a('function')
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
describe('`getSaveOptionalParameter`', () => {
|
|
55
|
-
it('is a function', () => {
|
|
56
|
-
return expect(getSaveOptionalParameter)
|
|
57
|
-
.to.be.a('function')
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
describe('`getSaveBundleParameter`', () => {
|
|
62
|
-
it('is a function', () => {
|
|
63
|
-
return expect(getSaveBundleParameter)
|
|
64
|
-
.to.be.a('function')
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
describe('`getRegistryParameter`', () => {
|
|
69
|
-
it('is a function', () => {
|
|
70
|
-
return expect(getRegistryParameter)
|
|
71
|
-
.to.be.a('function')
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
describe('`getNoSaveParameter`', () => {
|
|
76
|
-
it('is a function', () => {
|
|
77
|
-
return expect(getNoSaveParameter)
|
|
78
|
-
.to.be.a('function')
|
|
79
|
-
})
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
describe('`getSaveExactParameter`', () => {
|
|
83
|
-
it('is a function', () => {
|
|
84
|
-
return expect(getSaveExactParameter)
|
|
85
|
-
.to.be.a('function')
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
describe('`getCommands`', () => {
|
|
90
|
-
it('is a function', () => {
|
|
91
|
-
return expect(getCommands)
|
|
92
|
-
.to.be.a('function')
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
describe('`getProdDependencies`', () => {
|
|
97
|
-
it('is a function', () => {
|
|
98
|
-
return expect(getProdDependencies)
|
|
99
|
-
.to.be.a('function')
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
describe('`getDevDependencies`', () => {
|
|
104
|
-
it('is a function', () => {
|
|
105
|
-
return expect(getDevDependencies)
|
|
106
|
-
.to.be.a('function')
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
describe('`getOptionalDependencies`', () => {
|
|
111
|
-
it('is a function', () => {
|
|
112
|
-
return expect(getOptionalDependencies)
|
|
113
|
-
.to.be.a('function')
|
|
114
|
-
})
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
describe('`getBundleDependencies`', () => {
|
|
118
|
-
it('is a function', () => {
|
|
119
|
-
return expect(getBundleDependencies)
|
|
120
|
-
.to.be.a('function')
|
|
121
|
-
})
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
describe('`getPeerDependencies`', () => {
|
|
125
|
-
it('is a function', () => {
|
|
126
|
-
return expect(getPeerDependencies)
|
|
127
|
-
.to.be.a('function')
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
describe('`isExact`', () => {
|
|
132
|
-
it('is a function', () => {
|
|
133
|
-
return expect(isExact)
|
|
134
|
-
.to.be.a('function')
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
describe('`getDepsExact`', () => {
|
|
139
|
-
it('is a function', () => {
|
|
140
|
-
return expect(getDepsExact)
|
|
141
|
-
.to.be.a('function')
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
describe('`getDeps`', () => {
|
|
146
|
-
it('is a function', () => {
|
|
147
|
-
return expect(getDeps)
|
|
148
|
-
.to.be.a('function')
|
|
149
|
-
})
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
describe('`normalizeCommands`', () => {
|
|
153
|
-
it('is a function', () => {
|
|
154
|
-
return expect(normalizeCommands)
|
|
155
|
-
.to.be.a('function')
|
|
156
|
-
})
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
describe('`transformDependency`', () => {
|
|
160
|
-
it('is a function', () => {
|
|
161
|
-
return expect(transformDependency)
|
|
162
|
-
.to.be.a('function')
|
|
163
|
-
})
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
describe('`transform`', () => {
|
|
167
|
-
it('is a function', () => {
|
|
168
|
-
return expect(transform)
|
|
169
|
-
.to.be.a('function')
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
describe('`getSaveProdParameter()`', () => {
|
|
174
|
-
it('is a function', () => {
|
|
175
|
-
return expect(getSaveProdParameter('MOCK COMMANDS'))
|
|
176
|
-
.to.eql('MOCK COMMANDS --save-prod')
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
describe('`getSaveDevParameter()`', () => {
|
|
181
|
-
it('is a function', () => {
|
|
182
|
-
return expect(getSaveDevParameter('MOCK COMMANDS'))
|
|
183
|
-
.to.eql('MOCK COMMANDS --save-dev')
|
|
184
|
-
})
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
describe('`getSaveOptionalParameter()`', () => {
|
|
188
|
-
it('is a function', () => {
|
|
189
|
-
return expect(getSaveOptionalParameter('MOCK COMMANDS'))
|
|
190
|
-
.to.eql('MOCK COMMANDS --save-optional')
|
|
191
|
-
})
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
describe('`getSaveBundleParameter()`', () => {
|
|
195
|
-
it('is a function', () => {
|
|
196
|
-
return expect(getSaveBundleParameter('MOCK COMMANDS'))
|
|
197
|
-
.to.eql('MOCK COMMANDS --save-bundle')
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
describe('`getRegistryParameter()`', () => {
|
|
202
|
-
describe('The "registry" argument is truthy', () => {
|
|
203
|
-
it('returns a string', () => {
|
|
204
|
-
return expect(getRegistryParameter('MOCK REGISTRY', 'MOCK COMMANDS'))
|
|
205
|
-
.to.eql('MOCK COMMANDS --registry MOCK REGISTRY')
|
|
206
|
-
})
|
|
207
|
-
})
|
|
208
|
-
|
|
209
|
-
describe('The "registry" argument is falsy', () => {
|
|
210
|
-
it('returns a string', () => {
|
|
211
|
-
return expect(getRegistryParameter('', 'MOCK COMMANDS'))
|
|
212
|
-
.to.eql('MOCK COMMANDS')
|
|
213
|
-
})
|
|
214
|
-
})
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
describe('`getNoSaveParameter()`', () => {
|
|
218
|
-
describe('The "save" argument is truthy', () => {
|
|
219
|
-
it('returns a string', () => {
|
|
220
|
-
return expect(getNoSaveParameter(true, 'MOCK COMMANDS'))
|
|
221
|
-
.to.eql('MOCK COMMANDS')
|
|
222
|
-
})
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
describe('The "save" argument is falsy', () => {
|
|
226
|
-
it('returns a string', () => {
|
|
227
|
-
return expect(getNoSaveParameter(null, 'MOCK COMMANDS'))
|
|
228
|
-
.to.eql('MOCK COMMANDS --no-save')
|
|
229
|
-
})
|
|
230
|
-
})
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
describe('`getSaveExactParameter()`', () => {
|
|
234
|
-
it('is a function', () => {
|
|
235
|
-
return expect(getSaveExactParameter('MOCK COMMANDS'))
|
|
236
|
-
.to.eql('MOCK COMMANDS --save-exact')
|
|
237
|
-
})
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
describe('`isExact()`', () => {
|
|
241
|
-
describe('The dependency version is exact', () => {
|
|
242
|
-
it('returns an array', () => {
|
|
243
|
-
const dependency = '0.0.0'
|
|
244
|
-
|
|
245
|
-
return expect(isExact(dependency))
|
|
246
|
-
.to.be.true
|
|
247
|
-
})
|
|
248
|
-
})
|
|
249
|
-
|
|
250
|
-
describe('The dependency version is not exact', () => {
|
|
251
|
-
it('returns an array', () => {
|
|
252
|
-
const dependency = '^0.0.0'
|
|
253
|
-
|
|
254
|
-
return expect(isExact(dependency))
|
|
255
|
-
.to.be.false
|
|
256
|
-
})
|
|
257
|
-
})
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
describe('`getDeps()`', () => {
|
|
261
|
-
describe('The dependency version is exact', () => {
|
|
262
|
-
it('returns an array', () => {
|
|
263
|
-
const dependencies = {
|
|
264
|
-
'mock-package': '0.0.0'
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return expect(getDeps(dependencies))
|
|
268
|
-
.to.eql([])
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
|
|
272
|
-
describe('The dependency version is not exact', () => {
|
|
273
|
-
it('returns an array', () => {
|
|
274
|
-
const dependencies = {
|
|
275
|
-
'mock-package': '^0.0.0'
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return expect(getDeps(dependencies))
|
|
279
|
-
.to.eql([
|
|
280
|
-
{
|
|
281
|
-
name: 'mock-package',
|
|
282
|
-
version: 'latest'
|
|
283
|
-
}
|
|
284
|
-
])
|
|
285
|
-
})
|
|
286
|
-
})
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
describe('`getDepsExact()`', () => {
|
|
290
|
-
describe('The dependency version is exact', () => {
|
|
291
|
-
describe('With configuration', () => {
|
|
292
|
-
describe('The configuration version is exact', () => {
|
|
293
|
-
it('returns an array', () => {
|
|
294
|
-
const dependencies = {
|
|
295
|
-
'mock-package': '0.0.0'
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const configuration = {
|
|
299
|
-
'mock-package': '1.2.3'
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
return expect(getDepsExact(dependencies, configuration))
|
|
303
|
-
.to.eql([
|
|
304
|
-
{
|
|
305
|
-
name: 'mock-package',
|
|
306
|
-
version: '1.2.3'
|
|
307
|
-
}
|
|
308
|
-
])
|
|
309
|
-
})
|
|
310
|
-
})
|
|
311
|
-
|
|
312
|
-
describe('The configuration version is `latest`', () => {
|
|
313
|
-
it('returns an array', () => {
|
|
314
|
-
const dependencies = {
|
|
315
|
-
'mock-package': '0.0.0'
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const configuration = {
|
|
319
|
-
'mock-package': 'latest'
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
return expect(getDepsExact(dependencies, configuration))
|
|
323
|
-
.to.eql([
|
|
324
|
-
{
|
|
325
|
-
name: 'mock-package',
|
|
326
|
-
version: 'latest'
|
|
327
|
-
}
|
|
328
|
-
])
|
|
329
|
-
})
|
|
330
|
-
})
|
|
331
|
-
})
|
|
332
|
-
|
|
333
|
-
describe('Without configuration', () => {
|
|
334
|
-
it('returns an array', () => {
|
|
335
|
-
const dependencies = {
|
|
336
|
-
'mock-package': '0.0.0'
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
const configuration = {}
|
|
340
|
-
|
|
341
|
-
return expect(getDepsExact(dependencies, configuration))
|
|
342
|
-
.to.eql([
|
|
343
|
-
{
|
|
344
|
-
name: 'mock-package',
|
|
345
|
-
version: '0.0.0'
|
|
346
|
-
}
|
|
347
|
-
])
|
|
348
|
-
})
|
|
349
|
-
})
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
describe('The dependency version is not exact', () => {
|
|
353
|
-
describe('With configuration', () => {
|
|
354
|
-
it('returns an array', () => {
|
|
355
|
-
const dependencies = {
|
|
356
|
-
'mock-package': '^0.0.0'
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
const configuration = {
|
|
360
|
-
'mock-package': '1.2.3'
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
return expect(getDepsExact(dependencies, configuration))
|
|
364
|
-
.to.eql([])
|
|
365
|
-
})
|
|
366
|
-
})
|
|
367
|
-
|
|
368
|
-
describe('Without configuration', () => {
|
|
369
|
-
it('returns an array', () => {
|
|
370
|
-
const dependencies = {
|
|
371
|
-
'mock-package': '^0.0.0'
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const configuration = {
|
|
375
|
-
'mock-package': '1.2.3'
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
return expect(getDepsExact(dependencies, configuration))
|
|
379
|
-
.to.eql([])
|
|
380
|
-
})
|
|
381
|
-
})
|
|
382
|
-
})
|
|
383
|
-
})
|
|
384
|
-
})
|
package/test/index.spec.mjs
DELETED
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
import debug from 'debug'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
expect
|
|
5
|
-
} from 'chai'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
getInstallSaveProdSaveExactCommands,
|
|
9
|
-
getInstallSaveProdCommands,
|
|
10
|
-
getInstallSaveDevSaveExactCommands,
|
|
11
|
-
getInstallSaveDevCommands,
|
|
12
|
-
getInstallSaveOptionalSaveExactCommands,
|
|
13
|
-
getInstallSaveOptionalCommands,
|
|
14
|
-
getInstallSaveBundleSaveExactCommands,
|
|
15
|
-
getInstallSaveBundleCommands,
|
|
16
|
-
getInstallSaveExactCommands,
|
|
17
|
-
getInstallCommands,
|
|
18
|
-
installSaveProdSaveExact,
|
|
19
|
-
installSaveProd,
|
|
20
|
-
installSaveDevSaveExact,
|
|
21
|
-
installSaveDev,
|
|
22
|
-
installSaveOptionalSaveExact,
|
|
23
|
-
installSaveOptional,
|
|
24
|
-
installSaveBundleSaveExact,
|
|
25
|
-
installSaveBundle,
|
|
26
|
-
executeProd,
|
|
27
|
-
executeDev,
|
|
28
|
-
executeOptional,
|
|
29
|
-
executeBundle
|
|
30
|
-
} from '#deps/src'
|
|
31
|
-
|
|
32
|
-
describe('#deps/src', () => {
|
|
33
|
-
before(() => {
|
|
34
|
-
const {
|
|
35
|
-
env: {
|
|
36
|
-
DEBUG
|
|
37
|
-
}
|
|
38
|
-
} = process
|
|
39
|
-
|
|
40
|
-
if (DEBUG) debug.enable(DEBUG)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
describe('`getInstallSaveProdSaveExactCommands`', () => {
|
|
44
|
-
it('is a function', () => {
|
|
45
|
-
return expect(getInstallSaveProdSaveExactCommands)
|
|
46
|
-
.to.be.a('function')
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
describe('`getInstallSaveDevSaveExactCommands`', () => {
|
|
51
|
-
it('is a function', () => {
|
|
52
|
-
return expect(getInstallSaveDevSaveExactCommands)
|
|
53
|
-
.to.be.a('function')
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
describe('`getInstallSaveOptionalSaveExactCommands`', () => {
|
|
58
|
-
it('is a function', () => {
|
|
59
|
-
return expect(getInstallSaveOptionalSaveExactCommands)
|
|
60
|
-
.to.be.a('function')
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
describe('`getInstallSaveBundleSaveExactCommands`', () => {
|
|
65
|
-
it('is a function', () => {
|
|
66
|
-
return expect(getInstallSaveBundleSaveExactCommands)
|
|
67
|
-
.to.be.a('function')
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
describe('`getInstallSaveProdCommands`', () => {
|
|
72
|
-
it('is a function', () => {
|
|
73
|
-
return expect(getInstallSaveProdCommands)
|
|
74
|
-
.to.be.a('function')
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
describe('`getInstallSaveDevCommands`', () => {
|
|
79
|
-
it('is a function', () => {
|
|
80
|
-
return expect(getInstallSaveDevCommands)
|
|
81
|
-
.to.be.a('function')
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
describe('`getInstallSaveOptionalCommands`', () => {
|
|
86
|
-
it('is a function', () => {
|
|
87
|
-
return expect(getInstallSaveOptionalCommands)
|
|
88
|
-
.to.be.a('function')
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
describe('`getInstallSaveBundleCommands`', () => {
|
|
93
|
-
it('is a function', () => {
|
|
94
|
-
return expect(getInstallSaveBundleCommands)
|
|
95
|
-
.to.be.a('function')
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
describe('`getInstallSaveExactCommands`', () => {
|
|
100
|
-
it('is a function', () => {
|
|
101
|
-
return expect(getInstallSaveExactCommands)
|
|
102
|
-
.to.be.a('function')
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
describe('`getInstallCommands`', () => {
|
|
107
|
-
it('is a function', () => {
|
|
108
|
-
return expect(getInstallCommands)
|
|
109
|
-
.to.be.a('function')
|
|
110
|
-
})
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
describe('`installSaveProdSaveExact`', () => {
|
|
114
|
-
it('is a function', () => {
|
|
115
|
-
return expect(installSaveProdSaveExact)
|
|
116
|
-
.to.be.a('function')
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
describe('`installSaveProd`', () => {
|
|
121
|
-
it('is a function', () => {
|
|
122
|
-
return expect(installSaveProd)
|
|
123
|
-
.to.be.a('function')
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
describe('`installSaveDevSaveExact`', () => {
|
|
128
|
-
it('is a function', () => {
|
|
129
|
-
return expect(installSaveDevSaveExact)
|
|
130
|
-
.to.be.a('function')
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
describe('`installSaveDev`', () => {
|
|
135
|
-
it('is a function', () => {
|
|
136
|
-
return expect(installSaveDev)
|
|
137
|
-
.to.be.a('function')
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
describe('`installSaveOptionalSaveExact`', () => {
|
|
142
|
-
it('is a function', () => {
|
|
143
|
-
return expect(installSaveOptionalSaveExact)
|
|
144
|
-
.to.be.a('function')
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
describe('`installSaveOptional`', () => {
|
|
149
|
-
it('is a function', () => {
|
|
150
|
-
return expect(installSaveOptional)
|
|
151
|
-
.to.be.a('function')
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
describe('`installSaveBundleSaveExact`', () => {
|
|
156
|
-
it('is a function', () => {
|
|
157
|
-
return expect(installSaveBundleSaveExact)
|
|
158
|
-
.to.be.a('function')
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
describe('`installSaveBundle`', () => {
|
|
163
|
-
it('is a function', () => {
|
|
164
|
-
return expect(installSaveBundle)
|
|
165
|
-
.to.be.a('function')
|
|
166
|
-
})
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
describe('`executeProd`', () => {
|
|
170
|
-
it('is a function', () => {
|
|
171
|
-
return expect(executeProd)
|
|
172
|
-
.to.be.a('function')
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
describe('`executeDev`', () => {
|
|
177
|
-
it('is a function', () => {
|
|
178
|
-
return expect(executeDev)
|
|
179
|
-
.to.be.a('function')
|
|
180
|
-
})
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
describe('`executeOptional`', () => {
|
|
184
|
-
it('is an function', () => {
|
|
185
|
-
return expect(executeOptional)
|
|
186
|
-
.to.be.a('function')
|
|
187
|
-
})
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
describe('`executeBundle`', () => {
|
|
191
|
-
it('is an function', () => {
|
|
192
|
-
return expect(executeBundle)
|
|
193
|
-
.to.be.a('function')
|
|
194
|
-
})
|
|
195
|
-
})
|
|
196
|
-
|
|
197
|
-
describe('`getInstallSaveProdSaveExactCommands()`', () => {
|
|
198
|
-
describe('Always', () => {
|
|
199
|
-
it('returns a string', () => {
|
|
200
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
201
|
-
|
|
202
|
-
return expect(getInstallSaveProdSaveExactCommands(MOCK_PACKAGES))
|
|
203
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --save-prod')
|
|
204
|
-
})
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
describe('Registry is defined', () => {
|
|
208
|
-
it('returns a string', () => {
|
|
209
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
210
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
211
|
-
|
|
212
|
-
return expect(getInstallSaveProdSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
213
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --registry REGISTRY --save-prod')
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
describe('Force is true', () => {
|
|
217
|
-
it('returns a string', () => {
|
|
218
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
219
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
220
|
-
const MOCK_FORCE = true
|
|
221
|
-
|
|
222
|
-
return expect(getInstallSaveProdSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
223
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --force --registry REGISTRY --save-prod')
|
|
224
|
-
})
|
|
225
|
-
})
|
|
226
|
-
})
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
describe('`getInstallSaveDevSaveExactCommands()`', () => {
|
|
230
|
-
describe('Always', () => {
|
|
231
|
-
it('returns a string', () => {
|
|
232
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
233
|
-
|
|
234
|
-
return expect(getInstallSaveDevSaveExactCommands(MOCK_PACKAGES))
|
|
235
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --save-dev')
|
|
236
|
-
})
|
|
237
|
-
})
|
|
238
|
-
|
|
239
|
-
describe('Registry is defined', () => {
|
|
240
|
-
it('returns a string', () => {
|
|
241
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
242
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
243
|
-
|
|
244
|
-
return expect(getInstallSaveDevSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
245
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --registry REGISTRY --save-dev')
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
describe('Force is true', () => {
|
|
249
|
-
it('returns a string', () => {
|
|
250
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
251
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
252
|
-
const MOCK_FORCE = true
|
|
253
|
-
|
|
254
|
-
return expect(getInstallSaveDevSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
255
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --force --registry REGISTRY --save-dev')
|
|
256
|
-
})
|
|
257
|
-
})
|
|
258
|
-
})
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
describe('`getInstallSaveOptionalSaveExactCommands()`', () => {
|
|
262
|
-
describe('Always', () => {
|
|
263
|
-
it('returns a string', () => {
|
|
264
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
265
|
-
|
|
266
|
-
return expect(getInstallSaveOptionalSaveExactCommands(MOCK_PACKAGES))
|
|
267
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --save-optional')
|
|
268
|
-
})
|
|
269
|
-
})
|
|
270
|
-
|
|
271
|
-
describe('Registry is defined', () => {
|
|
272
|
-
it('returns a string', () => {
|
|
273
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
274
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
275
|
-
|
|
276
|
-
return expect(getInstallSaveOptionalSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
277
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --registry REGISTRY --save-optional')
|
|
278
|
-
})
|
|
279
|
-
|
|
280
|
-
describe('Force is true', () => {
|
|
281
|
-
it('returns a string', () => {
|
|
282
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
283
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
284
|
-
const MOCK_FORCE = true
|
|
285
|
-
|
|
286
|
-
return expect(getInstallSaveOptionalSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
287
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --force --registry REGISTRY --save-optional')
|
|
288
|
-
})
|
|
289
|
-
})
|
|
290
|
-
})
|
|
291
|
-
})
|
|
292
|
-
|
|
293
|
-
describe('`getInstallSaveBundleSaveExactCommands()`', () => {
|
|
294
|
-
describe('Always', () => {
|
|
295
|
-
it('returns a string', () => {
|
|
296
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
297
|
-
|
|
298
|
-
return expect(getInstallSaveBundleSaveExactCommands(MOCK_PACKAGES))
|
|
299
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --save-bundle')
|
|
300
|
-
})
|
|
301
|
-
})
|
|
302
|
-
|
|
303
|
-
describe('Registry is defined', () => {
|
|
304
|
-
it('returns a string', () => {
|
|
305
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
306
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
307
|
-
|
|
308
|
-
return expect(getInstallSaveBundleSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
309
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --registry REGISTRY --save-bundle')
|
|
310
|
-
})
|
|
311
|
-
|
|
312
|
-
describe('Force is true', () => {
|
|
313
|
-
it('returns a string', () => {
|
|
314
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
315
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
316
|
-
const MOCK_FORCE = true
|
|
317
|
-
|
|
318
|
-
return expect(getInstallSaveBundleSaveExactCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
319
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --force --registry REGISTRY --save-bundle')
|
|
320
|
-
})
|
|
321
|
-
})
|
|
322
|
-
})
|
|
323
|
-
})
|
|
324
|
-
|
|
325
|
-
describe('`getInstallSaveProdCommands()`', () => {
|
|
326
|
-
describe('Always', () => {
|
|
327
|
-
it('returns a string', () => {
|
|
328
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
329
|
-
|
|
330
|
-
return expect(getInstallSaveProdCommands(MOCK_PACKAGES))
|
|
331
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-prod')
|
|
332
|
-
})
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
describe('Registry is defined', () => {
|
|
336
|
-
it('returns a string', () => {
|
|
337
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
338
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
339
|
-
|
|
340
|
-
return expect(getInstallSaveProdCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
341
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY --save-prod')
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
describe('Force is true', () => {
|
|
345
|
-
it('returns a string', () => {
|
|
346
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
347
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
348
|
-
const MOCK_FORCE = true
|
|
349
|
-
|
|
350
|
-
return expect(getInstallSaveProdCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
351
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY --save-prod')
|
|
352
|
-
})
|
|
353
|
-
})
|
|
354
|
-
})
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
describe('`getInstallSaveDevCommands()`', () => {
|
|
358
|
-
describe('Always', () => {
|
|
359
|
-
it('returns a string', () => {
|
|
360
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
361
|
-
|
|
362
|
-
return expect(getInstallSaveDevCommands(MOCK_PACKAGES))
|
|
363
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-dev')
|
|
364
|
-
})
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
describe('Registry is defined', () => {
|
|
368
|
-
it('returns a string', () => {
|
|
369
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
370
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
371
|
-
|
|
372
|
-
return expect(getInstallSaveDevCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
373
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY --save-dev')
|
|
374
|
-
})
|
|
375
|
-
|
|
376
|
-
describe('Force is true', () => {
|
|
377
|
-
it('returns a string', () => {
|
|
378
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
379
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
380
|
-
const MOCK_FORCE = true
|
|
381
|
-
|
|
382
|
-
return expect(getInstallSaveDevCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
383
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY --save-dev')
|
|
384
|
-
})
|
|
385
|
-
})
|
|
386
|
-
})
|
|
387
|
-
})
|
|
388
|
-
|
|
389
|
-
describe('`getInstallSaveOptionalCommands()`', () => {
|
|
390
|
-
describe('Always', () => {
|
|
391
|
-
it('returns a string', () => {
|
|
392
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
393
|
-
|
|
394
|
-
return expect(getInstallSaveOptionalCommands(MOCK_PACKAGES))
|
|
395
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-optional')
|
|
396
|
-
})
|
|
397
|
-
})
|
|
398
|
-
|
|
399
|
-
describe('Registry is defined', () => {
|
|
400
|
-
it('returns a string', () => {
|
|
401
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
402
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
403
|
-
|
|
404
|
-
return expect(getInstallSaveOptionalCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
405
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY --save-optional')
|
|
406
|
-
})
|
|
407
|
-
|
|
408
|
-
describe('Force is true', () => {
|
|
409
|
-
it('returns a string', () => {
|
|
410
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
411
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
412
|
-
const MOCK_FORCE = true
|
|
413
|
-
|
|
414
|
-
return expect(getInstallSaveOptionalCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
415
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY --save-optional')
|
|
416
|
-
})
|
|
417
|
-
})
|
|
418
|
-
})
|
|
419
|
-
})
|
|
420
|
-
|
|
421
|
-
describe('`getInstallSaveBundleCommands()`', () => {
|
|
422
|
-
describe('Always', () => {
|
|
423
|
-
it('returns a string', () => {
|
|
424
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
425
|
-
|
|
426
|
-
return expect(getInstallSaveBundleCommands(MOCK_PACKAGES))
|
|
427
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-bundle')
|
|
428
|
-
})
|
|
429
|
-
})
|
|
430
|
-
|
|
431
|
-
describe('Registry is defined', () => {
|
|
432
|
-
it('returns a string', () => {
|
|
433
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
434
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
435
|
-
|
|
436
|
-
return expect(getInstallSaveBundleCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
437
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY --save-bundle')
|
|
438
|
-
})
|
|
439
|
-
|
|
440
|
-
describe('Force is true', () => {
|
|
441
|
-
it('returns a string', () => {
|
|
442
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
443
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
444
|
-
const MOCK_FORCE = true
|
|
445
|
-
|
|
446
|
-
return expect(getInstallSaveBundleCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
447
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY --save-bundle')
|
|
448
|
-
})
|
|
449
|
-
})
|
|
450
|
-
})
|
|
451
|
-
})
|
|
452
|
-
|
|
453
|
-
describe('`getInstallCommands()`', () => {
|
|
454
|
-
describe('Always', () => {
|
|
455
|
-
it('returns a string', () => {
|
|
456
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
457
|
-
|
|
458
|
-
return expect(getInstallCommands(MOCK_PACKAGES))
|
|
459
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION')
|
|
460
|
-
})
|
|
461
|
-
})
|
|
462
|
-
|
|
463
|
-
describe('Registry is defined', () => {
|
|
464
|
-
it('returns a string', () => {
|
|
465
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
466
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
467
|
-
|
|
468
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_REGISTRY))
|
|
469
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY')
|
|
470
|
-
})
|
|
471
|
-
|
|
472
|
-
describe('Force is true', () => {
|
|
473
|
-
it('returns a string', () => {
|
|
474
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
475
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
476
|
-
const MOCK_FORCE = true
|
|
477
|
-
|
|
478
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_REGISTRY, MOCK_FORCE))
|
|
479
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY')
|
|
480
|
-
})
|
|
481
|
-
})
|
|
482
|
-
})
|
|
483
|
-
})
|
|
484
|
-
})
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import debug from 'debug'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
expect
|
|
5
|
-
} from 'chai'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
getInstallSaveExactCommands,
|
|
9
|
-
getInstallCommands,
|
|
10
|
-
installSaveExact,
|
|
11
|
-
install,
|
|
12
|
-
execute
|
|
13
|
-
} from '#deps/src/install'
|
|
14
|
-
|
|
15
|
-
describe('#deps/src/install', () => {
|
|
16
|
-
before(() => {
|
|
17
|
-
const {
|
|
18
|
-
env: {
|
|
19
|
-
DEBUG
|
|
20
|
-
}
|
|
21
|
-
} = process
|
|
22
|
-
|
|
23
|
-
if (DEBUG) debug.enable(DEBUG)
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
describe('`getInstallSaveExactCommands`', () => {
|
|
27
|
-
it('is a function', () => {
|
|
28
|
-
return expect(getInstallSaveExactCommands)
|
|
29
|
-
.to.be.a('function')
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
describe('`getInstallCommands`', () => {
|
|
34
|
-
it('is a function', () => {
|
|
35
|
-
return expect(getInstallCommands)
|
|
36
|
-
.to.be.a('function')
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
describe('`installSaveExact`', () => {
|
|
41
|
-
it('is a function', () => {
|
|
42
|
-
return expect(installSaveExact)
|
|
43
|
-
.to.be.a('function')
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
describe('`install`', () => {
|
|
48
|
-
it('is a function', () => {
|
|
49
|
-
return expect(install)
|
|
50
|
-
.to.be.a('function')
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
describe('`execute`', () => {
|
|
55
|
-
it('is an function', () => {
|
|
56
|
-
return expect(execute)
|
|
57
|
-
.to.be.a('function')
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
describe('`getInstallSaveExactCommands()`', () => {
|
|
62
|
-
describe('Always', () => {
|
|
63
|
-
it('returns a string', () => {
|
|
64
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
65
|
-
|
|
66
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES))
|
|
67
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --no-save')
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
describe('Save is true', () => {
|
|
72
|
-
it('returns a string', () => {
|
|
73
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
74
|
-
const MOCK_SAVE = true
|
|
75
|
-
|
|
76
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES, MOCK_SAVE))
|
|
77
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact')
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
describe('Registry is defined', () => {
|
|
81
|
-
it('returns a string', () => {
|
|
82
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
83
|
-
const MOCK_SAVE = true
|
|
84
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
85
|
-
|
|
86
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY))
|
|
87
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --registry REGISTRY')
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
describe('Force is true', () => {
|
|
91
|
-
it('returns a string', () => {
|
|
92
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
93
|
-
const MOCK_SAVE = true
|
|
94
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
95
|
-
const MOCK_FORCE = true
|
|
96
|
-
|
|
97
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY, MOCK_FORCE))
|
|
98
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --force --registry REGISTRY')
|
|
99
|
-
})
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
describe('Save is false', () => {
|
|
105
|
-
it('returns a string', () => {
|
|
106
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
107
|
-
const MOCK_SAVE = false
|
|
108
|
-
|
|
109
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES, MOCK_SAVE))
|
|
110
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --no-save')
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
describe('Registry is defined', () => {
|
|
114
|
-
it('returns a string', () => {
|
|
115
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
116
|
-
const MOCK_SAVE = false
|
|
117
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
118
|
-
|
|
119
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY))
|
|
120
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --registry REGISTRY --no-save')
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
describe('Force is true', () => {
|
|
124
|
-
it('returns a string', () => {
|
|
125
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
126
|
-
const MOCK_SAVE = false
|
|
127
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
128
|
-
const MOCK_FORCE = true
|
|
129
|
-
|
|
130
|
-
return expect(getInstallSaveExactCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY, MOCK_FORCE))
|
|
131
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --save-exact --force --registry REGISTRY --no-save')
|
|
132
|
-
})
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
describe('`getInstallCommands()`', () => {
|
|
139
|
-
describe('Always', () => {
|
|
140
|
-
it('returns a string', () => {
|
|
141
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
142
|
-
|
|
143
|
-
return expect(getInstallCommands(MOCK_PACKAGES))
|
|
144
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --no-save')
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
describe('Save is true', () => {
|
|
149
|
-
it('returns a string', () => {
|
|
150
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
151
|
-
const MOCK_SAVE = true
|
|
152
|
-
|
|
153
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_SAVE))
|
|
154
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION')
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
describe('Registry is defined', () => {
|
|
158
|
-
it('returns a string', () => {
|
|
159
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
160
|
-
const MOCK_SAVE = true
|
|
161
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
162
|
-
|
|
163
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY))
|
|
164
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY')
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
describe('Force is true', () => {
|
|
168
|
-
it('returns a string', () => {
|
|
169
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
170
|
-
const MOCK_SAVE = true
|
|
171
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
172
|
-
const MOCK_FORCE = true
|
|
173
|
-
|
|
174
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY, MOCK_FORCE))
|
|
175
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY')
|
|
176
|
-
})
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
describe('Save is false', () => {
|
|
182
|
-
it('returns a string', () => {
|
|
183
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
184
|
-
const MOCK_SAVE = false
|
|
185
|
-
|
|
186
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_SAVE))
|
|
187
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --no-save')
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
describe('Registry is defined', () => {
|
|
191
|
-
it('returns a string', () => {
|
|
192
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
193
|
-
const MOCK_SAVE = false
|
|
194
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
195
|
-
|
|
196
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY))
|
|
197
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --registry REGISTRY --no-save')
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
describe('Force is true', () => {
|
|
201
|
-
it('returns a string', () => {
|
|
202
|
-
const MOCK_PACKAGES = { name: 'PACKAGE NAME', version: 'PACKAGE VERSION' }
|
|
203
|
-
const MOCK_SAVE = false
|
|
204
|
-
const MOCK_REGISTRY = 'REGISTRY'
|
|
205
|
-
const MOCK_FORCE = true
|
|
206
|
-
|
|
207
|
-
return expect(getInstallCommands(MOCK_PACKAGES, MOCK_SAVE, MOCK_REGISTRY, MOCK_FORCE))
|
|
208
|
-
.to.equal('npm i PACKAGE NAME@PACKAGE VERSION --force --registry REGISTRY --no-save')
|
|
209
|
-
})
|
|
210
|
-
})
|
|
211
|
-
})
|
|
212
|
-
})
|
|
213
|
-
})
|
|
214
|
-
})
|