@@ -330,10 +330,9 @@ describe('LicensePlugin', () => {
330330 'fake-package' : fakePackage ,
331331 } ) ;
332332
333- expect ( plugin . _cache ) . toEqual ( {
334- [ path . join ( __dirname , 'fixtures' , 'fake-package-1' , 'src' ) ] : pkg ,
335- [ path . join ( __dirname , 'fixtures' , 'fake-package-1' ) ] : pkg ,
336- } ) ;
333+ expect ( plugin . _cache . size ) . toBe ( 2 ) ;
334+ expect ( plugin . _cache . get ( path . join ( __dirname , 'fixtures' , 'fake-package-1' , 'src' ) ) ) . toEqual ( pkg ) ;
335+ expect ( plugin . _cache . get ( path . join ( __dirname , 'fixtures' , 'fake-package-1' ) ) ) . toEqual ( pkg ) ;
337336 } ) ;
338337
339338 it ( 'should load pkg and put null without package' , ( ) => {
@@ -342,9 +341,8 @@ describe('LicensePlugin', () => {
342341 plugin . scanDependency ( id ) ;
343342
344343 expect ( plugin . _dependencies ) . toEqual ( { } ) ;
345- expect ( plugin . _cache ) . toEqual ( {
346- [ path . normalize ( path . join ( __dirname , '..' , 'src' ) ) ] : null ,
347- } ) ;
344+ expect ( plugin . _cache . size ) . toBe ( 1 ) ;
345+ expect ( plugin . _cache . get ( path . normalize ( path . join ( __dirname , '..' , 'src' ) ) ) ) . toBeNull ( ) ;
348346 } ) ;
349347
350348 it ( 'should try to load pkg without leading NULL character ' , ( ) => {
@@ -359,19 +357,18 @@ describe('LicensePlugin', () => {
359357 'fake-package' : fakePackage ,
360358 } ) ;
361359
362- expect ( plugin . _cache ) . toEqual ( {
363- [ path . join ( __dirname , 'fixtures' , 'fake-package-1' , 'src' ) ] : pkg ,
364- [ path . join ( __dirname , 'fixtures' , 'fake-package-1' ) ] : pkg ,
365- } ) ;
360+ expect ( plugin . _cache . size ) . toBe ( 2 ) ;
361+ expect ( plugin . _cache . get ( path . join ( __dirname , 'fixtures' , 'fake-package-1' , 'src' ) ) ) . toEqual ( pkg ) ;
362+ expect ( plugin . _cache . get ( path . join ( __dirname , 'fixtures' , 'fake-package-1' ) ) ) . toEqual ( pkg ) ;
366363 } ) ;
367364
368365 it ( 'should load pkg and use the cache if available' , ( ) => {
369366 const existsSync = spyOn ( fs , 'existsSync' ) . and . callThrough ( ) ;
370367 const pkgPath = path . join ( __dirname , 'fixtures' , 'fake-package-1' ) ;
371368 const id = path . join ( pkgPath , 'src' , 'index.js' ) ;
372369
373- plugin . _cache [ path . join ( pkgPath , 'src' ) ] = null ;
374- plugin . _cache [ pkgPath ] = null ;
370+ plugin . _cache . set ( path . join ( pkgPath , 'src' ) , null ) ;
371+ plugin . _cache . set ( pkgPath , null ) ;
375372
376373 plugin . scanDependency ( id ) ;
377374
0 commit comments