@@ -70,7 +70,9 @@ describe("WatchTestCases", function() {
7070 describe ( testName , function ( ) {
7171 var tempDirectory = path . join ( __dirname , "js" , "watch-src" , category . name , testName ) ;
7272 var testDirectory = path . join ( casesPath , category . name , testName ) ;
73- var runs = fs . readdirSync ( testDirectory ) . sort ( ) . map ( function ( name ) {
73+ var runs = fs . readdirSync ( testDirectory ) . sort ( ) . filter ( function ( name ) {
74+ return fs . statSync ( path . join ( testDirectory , name ) ) . isDirectory ( ) ;
75+ } ) . map ( function ( name ) {
7476 return {
7577 name : name ,
7678 suite : describe ( name , function ( ) { } )
@@ -83,15 +85,17 @@ describe("WatchTestCases", function() {
8385 this . timeout ( 30000 ) ;
8486 var outputDirectory = path . join ( __dirname , "js" , "watch" , category . name , testName ) ;
8587
86- var options = {
87- context : tempDirectory ,
88- entry : "./index.js" ,
89- output : {
90- path : outputDirectory ,
91- pathinfo : true ,
92- filename : "bundle.js"
93- }
94- } ;
88+ var options = { } ;
89+ var configPath = path . join ( testDirectory , "webpack.config.js" ) ;
90+ if ( fs . existsSync ( configPath ) )
91+ options = require ( configPath ) ;
92+ if ( ! options . context ) options . context = tempDirectory ;
93+ if ( ! options . entry ) options . entry = "./index.js" ;
94+ if ( ! options . target ) options . target = "async-node" ;
95+ if ( ! options . output ) options . output = { } ;
96+ if ( ! options . output . path ) options . output . path = outputDirectory ;
97+ if ( typeof options . output . pathinfo === "undefined" ) options . output . pathinfo = true ;
98+ if ( ! options . output . filename ) options . output . filename = "bundle.js" ;
9599
96100 var runIdx = 0 ;
97101 var run = runs [ runIdx ] ;
0 commit comments