Skip to content

Commit 4098902

Browse files
authored
test: add source files for web-webworker and web-webworker-auto-public-path (#20554)
1 parent f97be67 commit 4098902

6 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const value = 42;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
it("should resolve public path automatically in web+webworker target", () => {
2+
expect(__webpack_public_path__).toBe("https://test.cases/path/");
3+
});
4+
5+
it("should load a dynamic import with auto public path", () => {
6+
return import("./chunk").then(({ value }) => {
7+
expect(value).toBe(42);
8+
});
9+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use strict";
2+
3+
/** @type {import("../../../../").Configuration} */
4+
module.exports = {
5+
target: ["web", "webworker"],
6+
output: {
7+
filename: "bundle0.js",
8+
publicPath: "auto",
9+
chunkLoading: "import-scripts",
10+
chunkFormat: "array-push"
11+
}
12+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const value = 42;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
it("should compile with web+webworker target", () => {
2+
expect(typeof self).toBe("object");
3+
});
4+
5+
it("should load a dynamic import", () => {
6+
return import("./chunk").then(({ value }) => {
7+
expect(value).toBe(42);
8+
});
9+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use strict";
2+
3+
/** @type {import("../../../../").Configuration} */
4+
module.exports = {
5+
target: ["web", "webworker"],
6+
output: {
7+
filename: "bundle0.js",
8+
publicPath: "https://test.cases/path/",
9+
chunkLoading: "import-scripts",
10+
chunkFormat: "array-push"
11+
}
12+
};

0 commit comments

Comments
 (0)