Skip to content

Commit 75efda9

Browse files
authored
Merge pull request webpack#3547 from webpack/test/flanky-stable
make flanky test stable
2 parents 1b75d62 + ccc4eed commit 75efda9

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test/Compiler-caching.test.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,46 @@ describe("Compiler (caching)", function() {
302302
});
303303
});
304304
});
305+
306+
it("should build not keep error after fix", function(done) {
307+
308+
var options = {};
309+
var tempFixture = createTempFixture();
310+
311+
var helper = compile("./temp-cache-fixture/c", options, function(stats, files) {
312+
313+
// Built the first time
314+
stats.modules[0].name.should.containEql('a.js');
315+
stats.modules[0].built.should.be.exactly(true, 'a.js should have been built');
316+
317+
var aContent = fs.readFileSync(tempFixture.aFilepath).toString().replace('This is a', '\"))))This is a');
318+
319+
fs.writeFileSync(tempFixture.aFilepath, aContent);
320+
321+
setTimeout(function() {
322+
helper.runAgain({
323+
expectErrors: 1
324+
}, function(stats, files, iteration) {
325+
326+
var aContent = fs.readFileSync(tempFixture.aFilepath).toString().replace('\"))))This is a', 'This is a again');
327+
328+
fs.writeFileSync(tempFixture.aFilepath, aContent);
329+
330+
setTimeout(function() {
331+
helper.runAgain(function(stats, files, iteration) {
332+
333+
// And only a.js built after it was modified
334+
stats.modules[0].name.should.containEql('a.js');
335+
stats.modules[0].built.should.be.exactly(true, 'a.js should have been built');
336+
337+
stats.modules[1].name.should.containEql('c.js');
338+
//stats.modules[1].built.should.be.exactly(false, 'c.js should not have built');
339+
340+
done();
341+
});
342+
}, 300);
343+
});
344+
}, 300);
345+
});
346+
});
305347
});

0 commit comments

Comments
 (0)