@@ -417,33 +417,61 @@ describe('The config-generator function', () => {
417
417
} ) ;
418
418
} ) ;
419
419
420
- describe ( 'disableAssetsLoaders () removes the default assets loaders ' , ( ) => {
421
- it ( 'without disableAssetsLoaders ()' , ( ) => {
420
+ describe ( 'disableImagesLoader () removes the default images loader ' , ( ) => {
421
+ it ( 'without disableImagesLoader ()' , ( ) => {
422
422
const config = createConfig ( ) ;
423
423
config . outputPath = '/tmp/output/public-path' ;
424
424
config . publicPath = '/public-path' ;
425
425
config . addEntry ( 'main' , './main' ) ;
426
- // do not call disableAssetsLoaders
426
+ // do not call disableImagesLoader
427
427
428
428
const actualConfig = configGenerator ( config ) ;
429
429
430
430
expect ( function ( ) {
431
431
findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g ) $ / , actualConfig . module . rules ) ;
432
- findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
433
432
} ) . to . not . throw ( ) ;
434
433
} ) ;
435
434
436
- it ( 'with disableAssetsLoaders ()' , ( ) => {
435
+ it ( 'with disableImagesLoader ()' , ( ) => {
437
436
const config = createConfig ( ) ;
438
437
config . outputPath = '/tmp/output/public-path' ;
439
438
config . publicPath = '/public-path' ;
440
439
config . addEntry ( 'main' , './main' ) ;
441
- config . disableAssetsLoaders ( ) ;
440
+ config . disableImagesLoader ( ) ;
442
441
443
442
const actualConfig = configGenerator ( config ) ;
444
443
445
444
expect ( function ( ) {
446
445
findRule ( / \. ( p n g | j p g | j p e g | g i f | i c o | s v g ) $ / , actualConfig . module . rules ) ;
446
+ } ) . to . throw ( ) ;
447
+ } ) ;
448
+ } ) ;
449
+
450
+ describe ( 'disableFontsLoader() removes the default fonts loader' , ( ) => {
451
+ it ( 'without disableFontsLoader()' , ( ) => {
452
+ const config = createConfig ( ) ;
453
+ config . outputPath = '/tmp/output/public-path' ;
454
+ config . publicPath = '/public-path' ;
455
+ config . addEntry ( 'main' , './main' ) ;
456
+ // do not call disableFontsLoader
457
+
458
+ const actualConfig = configGenerator ( config ) ;
459
+
460
+ expect ( function ( ) {
461
+ findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
462
+ } ) . to . not . throw ( ) ;
463
+ } ) ;
464
+
465
+ it ( 'with disableFontsLoader()' , ( ) => {
466
+ const config = createConfig ( ) ;
467
+ config . outputPath = '/tmp/output/public-path' ;
468
+ config . publicPath = '/public-path' ;
469
+ config . addEntry ( 'main' , './main' ) ;
470
+ config . disableFontsLoader ( ) ;
471
+
472
+ const actualConfig = configGenerator ( config ) ;
473
+
474
+ expect ( function ( ) {
447
475
findRule ( / \. ( w o f f | w o f f 2 | t t f | e o t | o t f ) $ / , actualConfig . module . rules ) ;
448
476
} ) . to . throw ( ) ;
449
477
} ) ;
0 commit comments