-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
/
index.js
54 lines (51 loc) · 1.88 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
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",
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",
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",
media: prod
? "my-app-491-w7"
: "./style.module.css-wideScreenClass",
supports: prod
? "my-app-491-T$"
: "./style.module.css-displayGridInSupports",
});
} 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"
);
});