Skip to content

Commit f8a5ac3

Browse files
authored
test: add coverage for nwjs exports condition and CSS modules with webworker target (#20530)
1 parent 59bf024 commit f8a5ac3

File tree

9 files changed

+48
-0
lines changed

9 files changed

+48
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.base {
2+
display: block;
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as style from "./style.modules.css";
2+
3+
it("should allow to import a css module", () => {
4+
expect(style.header).toContain("header");
5+
expect(style.header).toContain("base");
6+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.header {
2+
composes: base from "./base.modules.css";
3+
color: red;
4+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use strict";
2+
3+
/** @type {import("../../../../").Configuration} */
4+
module.exports = {
5+
target: "webworker",
6+
mode: "development",
7+
devtool: false,
8+
experiments: {
9+
css: true
10+
}
11+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const foo = require("foo");
2+
3+
it("should resolve the nwjs exports condition", () => {
4+
expect(foo).toBe("nwjs");
5+
});

test/configCases/target/nwjs/node_modules/foo/default.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/configCases/target/nwjs/node_modules/foo/nwjs.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/configCases/target/nwjs/node_modules/foo/package.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"use strict";
2+
3+
/** @type {import("../../../../").Configuration} */
4+
module.exports = {
5+
target: "nwjs",
6+
optimization: {
7+
minimize: false
8+
}
9+
};

0 commit comments

Comments
 (0)