@@ -375,57 +375,6 @@ describe('The config-generator function', () => {
375
375
// check for the default env preset only
376
376
expect ( JSON . stringify ( jsRule . use [ 0 ] . options . presets ) ) . contains ( 'env' ) ;
377
377
} ) ;
378
-
379
- it ( 'If .babelrc is present, we pass *no* config' , ( ) => {
380
- const runtimeConfig = new RuntimeConfig ( ) ;
381
- runtimeConfig . babelRcFileExists = true ;
382
- const config = createConfig ( runtimeConfig ) ;
383
- config . outputPath = '/tmp/output/public-path' ;
384
- config . publicPath = '/public-path' ;
385
- config . addEntry ( 'main' , './main' ) ;
386
-
387
- const actualConfig = configGenerator ( config ) ;
388
-
389
- const jsRule = findRule ( / \. j s x ? $ / , actualConfig . module . rules ) ;
390
-
391
- // the options should only contain the cacheDirectory option
392
- expect ( JSON . stringify ( jsRule . use [ 0 ] . options ) ) . to . equal ( JSON . stringify ( { 'cacheDirectory' : true } ) ) ;
393
- } ) ;
394
-
395
- it ( 'configureBabel() passes babel options' , ( ) => {
396
- const config = createConfig ( ) ;
397
- config . outputPath = '/tmp/output/public-path' ;
398
- config . publicPath = '/public-path' ;
399
- config . addEntry ( 'main' , './main' ) ;
400
- config . configureBabel ( function ( babelConfig ) {
401
- babelConfig . presets . push ( 'foo' ) ;
402
- } ) ;
403
-
404
- const actualConfig = configGenerator ( config ) ;
405
-
406
- const jsRule = findRule ( / \. j s x ? $ / , actualConfig . module . rules ) ;
407
-
408
- expect ( jsRule . use [ 0 ] . options . presets ) . to . include ( 'foo' ) ;
409
- } ) ;
410
-
411
- it ( 'enableReactPreset() passes react preset to babel' , ( ) => {
412
- const config = createConfig ( ) ;
413
- config . outputPath = '/tmp/output/public-path' ;
414
- config . publicPath = '/public-path' ;
415
- config . addEntry ( 'main' , './main' ) ;
416
- config . enableReactPreset ( ) ;
417
- config . configureBabel ( function ( babelConfig ) {
418
- babelConfig . presets . push ( 'foo' ) ;
419
- } ) ;
420
-
421
- const actualConfig = configGenerator ( config ) ;
422
-
423
- const jsRule = findRule ( / \. j s x ? $ / , actualConfig . module . rules ) ;
424
-
425
- expect ( jsRule . use [ 0 ] . options . presets ) . to . include ( 'react' ) ;
426
- // foo is also still there, not overridden
427
- expect ( jsRule . use [ 0 ] . options . presets ) . to . include ( 'foo' ) ;
428
- } ) ;
429
378
} ) ;
430
379
431
380
describe ( 'cleanupOutputBeforeBuild() adds CleanWebpackPlugin' , ( ) => {
0 commit comments