@@ -10,7 +10,8 @@ const {
10
10
addNodeVersionToTravisYML,
11
11
addNewLowestAndDeprecate,
12
12
hasNodeVersion,
13
- getLockfilePath
13
+ getLockfilePath,
14
+ getLicenseAndAuthorFromVersions
14
15
} = require ( '../../utils/utils' )
15
16
16
17
const { cleanCache } = require ( '../helpers/module-cache-helpers' )
@@ -260,6 +261,39 @@ test('getOldVersionResolved', () => {
260
261
expect ( output ) . toEqual ( '9.3.1' )
261
262
} )
262
263
264
+ test ( 'getLicenseAndAuthorFromVersions' , ( ) => {
265
+ const version = '2.2.2'
266
+ const oldVersionResolved = '1.1.1'
267
+ const versions = {
268
+ '1.1.1' : {
269
+ 'repository' : {
270
+ 'type' : 'git' ,
271
+ 'url' : 'git+https://github.com/cat/cat.git'
272
+ } ,
273
+ 'license' : 'MIT' ,
274
+ '_npmUser' : {
275
+ name : 'finn' ,
276
+ email : 'finn.pauls@gmail.com'
277
+ } ,
278
+ '2.2.2' : {
279
+ 'repository' : {
280
+ 'type' : 'git' ,
281
+ 'url' : 'git+https://github.com/best/best.git'
282
+ } ,
283
+ 'license' : 'MIT' ,
284
+ '_npmUser' : {
285
+ name : 'finn' ,
286
+ email : 'finn.pauls@gmail.com'
287
+ }
288
+ }
289
+ }
290
+ }
291
+ const output = getLicenseAndAuthorFromVersions ( { versions, version, oldVersionResolved } )
292
+ console . log ( '### output' , output )
293
+ // returns the last satisfying version
294
+ expect ( output ) . toEqual ( '9.3.1' )
295
+ } )
296
+
263
297
test ( 'Use default env.GITHUB_URL in github compare URL' , ( ) => {
264
298
const fullName = 'hanshansen/mopeds'
265
299
const branch = 'master'
0 commit comments