-
-
Notifications
You must be signed in to change notification settings - Fork 608
/
Copy pathlocalsTest.js
52 lines (50 loc) · 1.21 KB
/
localsTest.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
/*globals describe */
var testLocals = require("./helpers").testLocals;
describe("locals", function() {
testLocals("should return only locals",
".abc :local(.def) { color: red; } :local .ghi .jkl { color: blue; }",
{
def: "_def",
ghi: "_ghi",
jkl: "_jkl"
},
"?localIdentName=_[local]"
);
testLocals("should return only locals with composing",
":local(.abc) { color: red; } :local(.def) { composes: abc; background: green; }",
{
abc: "_abc",
def: "_def _abc"
},
"?localIdentName=_[local]"
);
testLocals("should return only locals with importing",
":local(.abc) { composes: def from \"./module.css\"; }",
{
abc: "_abc imported_def imported_ghi"
},
"?localIdentName=_[local]",
{
"./module.css": {
def: "imported_def imported_ghi",
ghi: "imported_ghi"
}
}
);
testLocals("should return only locals with importing",
":local(.abc) { composes: def from \"./module1.css\"; composes: def from \"./module2.css\"; }",
{
abc: "_abc imported_def1 imported_ghi1 imported_def2"
},
"?localIdentName=_[local]",
{
"./module1.css": {
def: "imported_def1 imported_ghi1",
ghi: "imported_ghi1"
},
"./module2.css": {
def: "imported_def2"
}
}
);
});