Skip to content

Commit 383d625

Browse files
test: code coverange
1 parent 908ecee commit 383d625

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

test/runtime/__snapshots__/api.test.js.snap

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
exports[`api should import modules 1`] = `"body { b: 2; }body { c: 3; }body { b: 2; }@media print {body { b: 2; }}@media print {body { d: 4; }}@media screen and (orientation:landscape) {body { a: 1; }}@media (orientation:landscape) {body { a: 1; }}"`;
44

5+
exports[`api should import modules with dedupe 1`] = `"@media {.button { b: 2; }}"`;
6+
57
exports[`api should import named modules 1`] = `"body { b: 2; }body { c: 3; }body { b: 2; }@media print {body { b: 2; }}@media print {body { d: 4; }}@media screen {body { a: 1; }}"`;
68

79
exports[`api should toString a single module 1`] = `"body { a: 1; }"`;

test/runtime/api.test.js

+21
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,25 @@ describe('api', () => {
137137

138138
expect(m.toString()).toMatchSnapshot();
139139
});
140+
141+
it('should import modules with dedupe', () => {
142+
const m = api();
143+
const m1 = api();
144+
const m2 = api();
145+
146+
const m3 = ['./module3', '.button { b: 2; }', ''];
147+
const m4 = ['./module4', 'body { b: 3; }', ''];
148+
const m5 = ['./module5', 'body { d: 4; }', ''];
149+
150+
m.i(m1, '', true);
151+
m.i(m2, '', true);
152+
m1.i(m3, '', true);
153+
m1.i(m4, '', true);
154+
m2.i(m3, '', true);
155+
m2.i(m5, '', true);
156+
157+
m.push(m1);
158+
159+
expect(m.toString()).toMatchSnapshot();
160+
});
140161
});

0 commit comments

Comments
 (0)