Skip to content
Permalink
Browse files
Merge pull request #4471 from SteveMieskoski/increase-coverage-for-Au…
…tomaticPrefetchPlugin

add tests to test/WatchCases for AutomaticPrefetchPlugin
  • Loading branch information
sokra committed Mar 18, 2017
2 parents fadafb2 + a920c12 commit 335ce5f6b715bab47fb6c87f4a45c4c9702653e5
@@ -0,0 +1,5 @@
var a = require("./a");
var b = require("./b");
var c = require("./c");

module.exports = a + b + c + '.0';
@@ -0,0 +1 @@
module.exports = "This ";
@@ -0,0 +1 @@
module.exports = "is only ";
@@ -0,0 +1 @@
module.exports = "a test";
@@ -0,0 +1,9 @@
it("should watch for changes", function() {
require("./foo/" + WATCH_STEP).should.be.eql('This is only a test.' + WATCH_STEP);
if(+WATCH_STEP > 0) {
STATS_JSON.modules[0].prefetched.should.be.true();
STATS_JSON.modules[1].prefetched.should.be.true();
STATS_JSON.modules[2].prefetched.should.be.true();
STATS_JSON.modules[3].prefetched.should.be.true();
}
});
@@ -0,0 +1,5 @@
var a = require("./a");
var b = require("./b");
var c = require("./c");

module.exports = a + b + c + '.1';
@@ -0,0 +1,5 @@
var a = require("./a");
var b = require("./b");
var c = require("./c");

module.exports = a + b + c + '.2';
@@ -0,0 +1,5 @@
var a = require("./a");
var b = require("./b");
var c = require("./c");

module.exports = a + b + c + '.3';
@@ -0,0 +1,6 @@
var webpack = require("../../../../");
module.exports = {
plugins: [
new webpack.AutomaticPrefetchPlugin()
]
};

0 comments on commit 335ce5f

Please sign in to comment.