Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 13, 2021
1 parent f72b803 commit 684d375
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 0 deletions.
@@ -0,0 +1 @@
})]
@@ -0,0 +1 @@
module.exports = '0';
@@ -0,0 +1 @@
module.exports = "This ";
@@ -0,0 +1 @@
module.exports = "is only ";
@@ -0,0 +1 @@
module.exports = "a test";
10 changes: 10 additions & 0 deletions test/watchCases/plugins/automatic-prefetch-plugin-9485/0/index.js
@@ -0,0 +1,10 @@
it("should watch for changes", function () {
if (+WATCH_STEP !== 3) expect(require("./delayed")).toBe(WATCH_STEP);
else expect(require("./delayed")).toBe("This is only a test." + WATCH_STEP);
if (+WATCH_STEP > 0) {
for (var m of STATS_JSON.modules.filter(m =>
/(a|b|c)\.js$/.test(m.identifier)
))
expect(m.issuer).toBe(null);
}
});
@@ -0,0 +1 @@
module.exports = '1';
@@ -0,0 +1 @@
module.exports = '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,9 @@
module.exports = function (source) {
expect(source).toMatch(/^\}\)\]/);
this.cacheable(false);
return new Promise(resolve => {
setTimeout(() => {
resolve("module.exports = require('./foo/' + WATCH_STEP);");
}, 500);
});
};
@@ -0,0 +1,15 @@
const path = require("path");
const webpack = require("../../../../");

/** @type {import("../../../../").Configuration} */
module.exports = {
module: {
rules: [
{
test: /delayed/,
use: path.resolve(__dirname, "./delayed")
}
]
},
plugins: [new webpack.AutomaticPrefetchPlugin()]
};

0 comments on commit 684d375

Please sign in to comment.