Skip to content

Commit 421c2d4

Browse files
committed
added test case for minimized plus local
1 parent 420bd9e commit 421c2d4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/localTest.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
/*globals describe */
22

33
var test = require("./helpers").test;
4+
var testMinimize = require("./helpers").testMinimize;
45

56
function testLocal(name, input, result, localsResult, query, modules) {
67
result.locals = localsResult;
78
test(name, input, result, query, modules);
89
}
910

11+
function testLocalMinimize(name, input, result, localsResult, query, modules) {
12+
result.locals = localsResult;
13+
testMinimize(name, input, result, query, modules);
14+
}
15+
1016
describe("local", function() {
1117
testLocal("locals-format", ":local(.test) { background: red; }", [
1218
[1, ".test-3tNsp { background: red; }", ""]
@@ -22,6 +28,13 @@ describe("local", function() {
2228
someId: "_1j3LM6lKkKzRIt19ImYVnD",
2329
subClass: "_13LGdX8RMStbBE9w-t0gZ1"
2430
});
31+
testLocalMinimize("minimized plus local", ":local(.localClass) { background: red; }\n:local .otherClass { background: red; }\n:local(.empty) { }", [
32+
[1, "._localClass,._otherClass{background:red}", ""]
33+
], {
34+
localClass: "_localClass",
35+
otherClass: "_otherClass",
36+
empty: "_empty"
37+
}, "?localIdentName=_[local]");
2538
testLocal("mode switching", ".c1 :local .c2 .c3 :global .c4 :local .c5, .c6 :local .c7 { background: red; }\n.c8 { background: red; }", [
2639
[1, ".c1 ._c2 ._c3 .c4 ._c5, .c6 ._c7 { background: red; }\n.c8 { background: red; }", ""]
2740
], {

0 commit comments

Comments
 (0)