@@ -8,6 +8,10 @@ var checkArrayExpectation = require("./checkArrayExpectation");
88var Stats = require ( "../lib/Stats" ) ;
99var webpack = require ( "../lib/webpack" ) ;
1010
11+ function getConfig ( testDirectory ) {
12+ return require ( path . join ( testDirectory , "webpack.config.js" ) ) ;
13+ }
14+
1115describe ( "ConfigTestCases" , function ( ) {
1216 var casesPath = path . join ( __dirname , "configCases" ) ;
1317 var categories = fs . readdirSync ( casesPath ) ;
@@ -25,7 +29,7 @@ describe("ConfigTestCases", function() {
2529 category . tests . filter ( function ( testName ) {
2630 var testDirectory = path . join ( casesPath , category . name , testName ) ;
2731 var filterPath = path . join ( testDirectory , "test.filter.js" ) ;
28- var config = require ( path . join ( testDirectory , "webpack.config.js" ) ) ;
32+ var config = getConfig ( testDirectory ) ;
2933 if ( fs . existsSync ( filterPath ) && ! require ( filterPath ) ( config ) ) {
3034 describe . skip ( testName , function ( ) {
3135 it ( 'filtered' ) ;
@@ -36,7 +40,7 @@ describe("ConfigTestCases", function() {
3640 } ) . forEach ( function ( testName ) {
3741 var testDirectory = path . join ( casesPath , category . name , testName ) ;
3842 var filterPath = path . join ( testDirectory , "test.filter.js" ) ;
39- var options = require ( path . join ( testDirectory , "webpack.config.js" ) ) ;
43+ var options = getConfig ( testDirectory ) ;
4044 var suite = describe ( testName , function ( ) { } ) ;
4145 it ( testName + " should compile" , function ( done ) {
4246 this . timeout ( 30000 ) ;
0 commit comments