Skip to content

Commit e2befc3

Browse files
committed
tests for higher coverage.
1 parent fe916d5 commit e2befc3

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

test/externalsTest.js

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,50 +15,53 @@ describe("externals", function() {
1515
};
1616
});
1717

18-
testLocal(
19-
// name
20-
"composes class from external module",
18+
[
19+
{
20+
name: "composes class from external module, with query string",
21+
query: '?localIdentName=_[local]&externals={"external":"External"}',
22+
},
23+
{
24+
name: "composes class from external module, with externals as an array",
25+
query: '?{"localIdentName":"_[local]","externals":[{"external":"External"}]}',
26+
}
27+
].forEach(function (t) {
28+
testLocal(
29+
// name
30+
t.name,
2131

22-
// input
23-
[
24-
":local(.c1) { composes: c2 from \"external\"; b: 1; }",
25-
":local(.c3) { composes: c1; b: 3; }",
26-
":local(.c5) { composes: c2 c4 from \"external\"; b: 5; }"
27-
].join("\n"),
32+
// input
33+
[
34+
":local(.c1) { composes: c2 from \"external\"; b: 1; }",
35+
":local(.c3) { composes: c1; b: 3; }",
36+
":local(.c5) { composes: c2 c4 from \"external\"; b: 5; }"
37+
].join("\n"),
2838

29-
// result
30-
[
39+
// result
3140
[
32-
1,
3341
[
34-
"._c1 { b: 1; }",
35-
"._c3 { b: 3; }",
36-
"._c5 { b: 5; }"
37-
].join("\n"), ""
38-
]
39-
],
42+
1,
43+
[
44+
"._c1 { b: 1; }",
45+
"._c3 { b: 3; }",
46+
"._c5 { b: 5; }"
47+
].join("\n"), ""
48+
]
49+
],
4050

41-
// localsResult
42-
{
43-
c1: "_c1 imported-c2",
44-
c3: "_c3 _c1 imported-c2",
45-
c5: "_c5 imported-c2 imported-c4"
46-
},
51+
// localsResult
52+
{
53+
c1: "_c1 imported-c2",
54+
c3: "_c3 _c1 imported-c2",
55+
c5: "_c5 imported-c2 imported-c4"
56+
},
4757

48-
// query
49-
'?localIdentName=_[local]&externals={"external":"External"}',
58+
// query
59+
t.query,
5060

51-
// @TODO: test with query as an object too
52-
// {
53-
// localIdentName: '_[local]',
54-
// externals: {
55-
// external: 'External'
56-
// }
57-
// },
58-
59-
// modules
60-
{}
61-
);
61+
// modules
62+
{}
63+
);
64+
});
6265

6366
after(function () {
6467
delete global.External;

0 commit comments

Comments
 (0)