@@ -308,4 +308,46 @@ describe("Compiler (caching)", function() {
308308 } ) ;
309309 } ) ;
310310 } ) ;
311+
312+ it ( "should build not keep error after fix" , function ( done ) {
313+
314+ var options = { } ;
315+ var tempFixture = createTempFixture ( ) ;
316+
317+ var helper = compile ( "./temp-cache-fixture/c" , options , function ( stats , files ) {
318+
319+ // Built the first time
320+ stats . modules [ 0 ] . name . should . containEql ( 'a.js' ) ;
321+ stats . modules [ 0 ] . built . should . be . exactly ( true , 'a.js should have been built' ) ;
322+
323+ var aContent = fs . readFileSync ( tempFixture . aFilepath ) . toString ( ) . replace ( 'This is a' , '\"))))This is a' ) ;
324+
325+ fs . writeFileSync ( tempFixture . aFilepath , aContent ) ;
326+
327+ setTimeout ( function ( ) {
328+ helper . runAgain ( {
329+ expectErrors : 1
330+ } , function ( stats , files , iteration ) {
331+
332+ var aContent = fs . readFileSync ( tempFixture . aFilepath ) . toString ( ) . replace ( '\"))))This is a' , 'This is a again' ) ;
333+
334+ fs . writeFileSync ( tempFixture . aFilepath , aContent ) ;
335+
336+ setTimeout ( function ( ) {
337+ helper . runAgain ( function ( stats , files , iteration ) {
338+
339+ // And only a.js built after it was modified
340+ stats . modules [ 0 ] . name . should . containEql ( 'a.js' ) ;
341+ stats . modules [ 0 ] . built . should . be . exactly ( true , 'a.js should have been built' ) ;
342+
343+ stats . modules [ 1 ] . name . should . containEql ( 'c.js' ) ;
344+ //stats.modules[1].built.should.be.exactly(false, 'c.js should not have built');
345+
346+ done ( ) ;
347+ } ) ;
348+ } , 300 ) ;
349+ } ) ;
350+ } , 300 ) ;
351+ } ) ;
352+ } ) ;
311353} ) ;
0 commit comments