@@ -28,7 +28,6 @@ import tmp from 'tmp';
28
28
import moment from 'moment' ;
29
29
import { licensePlugin } from '../src/license-plugin.js' ;
30
30
import { join } from './utils/join.js' ;
31
- import { pkg } from '../scripts/config' ;
32
31
33
32
describe ( 'LicensePlugin' , ( ) => {
34
33
let tmpDir ;
@@ -110,6 +109,7 @@ describe('LicensePlugin', () => {
110
109
description : 'Fake package used in unit tests' ,
111
110
license : 'MIT' ,
112
111
licenseText : null ,
112
+ noticeText : null ,
113
113
private : true ,
114
114
homepage : null ,
115
115
repository : null ,
@@ -190,6 +190,7 @@ describe('LicensePlugin', () => {
190
190
private : true ,
191
191
license : 'MIT' ,
192
192
licenseText : null ,
193
+ noticeText : null ,
193
194
author : null ,
194
195
contributors : [ ] ,
195
196
} ,
@@ -238,6 +239,21 @@ describe('LicensePlugin', () => {
238
239
} ) ;
239
240
} ) ;
240
241
242
+ it ( 'should load pkg and find notice file' , ( ) => {
243
+ const id = path . join ( __dirname , 'fixtures' , 'fake-package-11' , 'src' , 'index.js' ) ;
244
+
245
+ plugin . scanDependency ( id ) ;
246
+
247
+ expect ( addDependency ) . toHaveBeenCalled ( ) ;
248
+ expect ( plugin . _dependencies ) . toEqual ( {
249
+ 'fake-package' : {
250
+ ...fakePackage ,
251
+ licenseText : 'license.md file' ,
252
+ noticeText : 'notice.md file' ,
253
+ } ,
254
+ } ) ;
255
+ } ) ;
256
+
241
257
it ( 'should load pkg including license text from license.md file ignoring case of license file' , ( ) => {
242
258
const id = path . join ( __dirname , 'fixtures' , 'fake-package-8' , 'src' , 'index.js' ) ;
243
259
@@ -415,6 +431,7 @@ describe('LicensePlugin', () => {
415
431
description : 'Fake Description' ,
416
432
license : 'MIT' ,
417
433
licenseText : null ,
434
+ noticeText : null ,
418
435
homepage : 'https://www.google.fr' ,
419
436
private : true ,
420
437
maintainers : [ ] ,
@@ -1205,6 +1222,7 @@ describe('LicensePlugin', () => {
1205
1222
description : 'Foo Package' ,
1206
1223
license : 'MIT' ,
1207
1224
licenseText : null ,
1225
+ noticeText : null ,
1208
1226
private : false ,
1209
1227
homepage : null ,
1210
1228
repository : null ,
@@ -1242,6 +1260,7 @@ describe('LicensePlugin', () => {
1242
1260
description : 'Foo Package' ,
1243
1261
license : 'MIT' ,
1244
1262
licenseText : null ,
1263
+ noticeText : null ,
1245
1264
private : false ,
1246
1265
homepage : null ,
1247
1266
repository : null ,
@@ -1281,6 +1300,7 @@ describe('LicensePlugin', () => {
1281
1300
description : 'Foo Package' ,
1282
1301
license : 'MIT' ,
1283
1302
licenseText : null ,
1303
+ noticeText : null ,
1284
1304
private : false ,
1285
1305
maintainers : [ ] ,
1286
1306
contributors : [ ] ,
@@ -1298,6 +1318,7 @@ describe('LicensePlugin', () => {
1298
1318
description : 'Bar Package' ,
1299
1319
license : 'Apache 2.0' ,
1300
1320
licenseText : null ,
1321
+ noticeText : null ,
1301
1322
maintainers : [ ] ,
1302
1323
contributors : [ ] ,
1303
1324
author : null ,
0 commit comments