forked from webpack/webpack
/
index.js
62 lines (59 loc) · 2.49 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const prod = process.env.NODE_ENV === "production";
it("should allow to create css modules", done => {
import("../css-modules/use-style.js").then(({ default: x }) => {
try {
expect(x).toEqual({
global: undefined,
class: prod ? "my-app-491-S" : "./style.module.css-class",
currentWmultiParams: prod ? "my-app-491-yK" : "./style.module.css-local12",
futureWmultiParams: prod ? "my-app-491-Y4" : "./style.module.css-local14",
hasWmultiParams: prod ? "my-app-491-PK" : "./style.module.css-local11",
matchesWmultiParams: prod ? "my-app-491-$Y" : "./style.module.css-local9",
mozAnyWmultiParams: prod ? "my-app-491-TT" : "./style.module.css-local15",
pastWmultiParams: prod ? "my-app-491-P_" : "./style.module.css-local13",
webkitAnyWmultiParams: prod ? "my-app-491-rT" : "./style.module.css-local16",
whereWmultiParams: prod ? "my-app-491-ie" : "./style.module.css-local10",
local: prod
? "my-app-491-Zw my-app-491-yl my-app-491-J_ my-app-491-gc"
: "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4",
local2: prod
? "my-app-491-Xg my-app-491-AY"
: "./style.module.css-local5 ./style.module.css-local6",
nested: prod
? "my-app-491-RX undefined my-app-491-X2"
: "./style.module.css-nested1 undefined ./style.module.css-nested3",
notWmultiParams: prod
? "my-app-491-Kw"
: "./style.module.css-local7",
isWmultiParams: prod
? "my-app-491-rw"
: "./style.module.css-local8",
ident: prod ? "my-app-491-yR" : "./style.module.css-ident",
keyframes: prod ? "my-app-491-y3" : "./style.module.css-localkeyframes",
animation: prod ? "my-app-491-oQ" : "./style.module.css-animation",
vars: prod
? "--my-app-491-y4 my-app-491-gR undefined my-app-491-xk"
: "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars"
});
} catch (e) {
return done(e);
}
done();
}, done);
});
import * as style from "../css-modules/style.module.css";
it("should allow to import css modules", () => {
expect(style.class).toBe(prod ? "my-app-491-S" : "./style.module.css-class");
expect(style.local1).toBe(
prod ? "my-app-491-Zw" : "./style.module.css-local1"
);
expect(style.local2).toBe(
prod ? "my-app-491-yl" : "./style.module.css-local2"
);
expect(style.local3).toBe(
prod ? "my-app-491-J_" : "./style.module.css-local3"
);
expect(style.local4).toBe(
prod ? "my-app-491-gc" : "./style.module.css-local4"
);
});