@@ -29,7 +29,9 @@ describe("StatsTestCases", () => {
2929 }
3030 } ;
3131 if ( fs . existsSync ( path . join ( base , testName , "webpack.config.js" ) ) ) {
32- options = require ( path . join ( base , testName , "webpack.config.js" ) ) ;
32+ options = require (
33+ path . join ( base , testName , "webpack.config.js" )
34+ ) ;
3335 }
3436 ( Array . isArray ( options ) ? options : [ options ] ) . forEach ( options => {
3537 if ( ! options . context ) options . context = path . join ( base , testName ) ;
@@ -70,13 +72,11 @@ describe("StatsTestCases", () => {
7072 } ) ;
7173 c . run ( ( err , stats ) => {
7274 if ( err ) return done ( err ) ;
73-
7475 if ( / e r r o r $ / . test ( testName ) ) {
7576 expect ( stats . hasErrors ( ) ) . toBe ( true ) ;
7677 } else if ( stats . hasErrors ( ) ) {
7778 return done ( new Error ( stats . toJson ( ) . errors . join ( "\n\n" ) ) ) ;
7879 }
79-
8080 let toStringOptions = {
8181 context : path . join ( base , testName ) ,
8282 colors : false
@@ -86,15 +86,13 @@ describe("StatsTestCases", () => {
8686 toStringOptions = options . stats ;
8787 if ( toStringOptions === null || typeof toStringOptions !== "object" )
8888 toStringOptions = Stats . presetToOptions ( toStringOptions ) ;
89-
9089 hasColorSetting = typeof options . stats . colors !== "undefined" ;
9190 if ( ! toStringOptions . context )
9291 toStringOptions . context = path . join ( base , testName ) ;
9392 }
9493 if ( Array . isArray ( options ) && ! toStringOptions . children ) {
9594 toStringOptions . children = options . map ( o => o . stats ) ;
9695 }
97-
9896 let actual = stats . toString ( toStringOptions ) ;
9997 expect ( typeof actual ) . toBe ( "string" ) ;
10098 if ( ! hasColorSetting ) {
@@ -117,7 +115,6 @@ describe("StatsTestCases", () => {
117115 "$1 Thu Jan 01 1970 <CLR=BOLD>00:00:00</CLR> GMT"
118116 ) ;
119117 }
120-
121118 actual = actual
122119 . replace ( / \r \n ? / g, "\n" )
123120 . replace ( / [ \t ] * V e r s i o n : .+ \n / g, "" )
0 commit comments