Skip to content

Commit a54c955

Browse files
test: imports
1 parent 5b45d87 commit a54c955

File tree

6 files changed

+604
-8
lines changed

6 files changed

+604
-8
lines changed

test/__snapshots__/import-option.test.js.snap

+418-4
Large diffs are not rendered by default.

test/__snapshots__/url-option.test.js.snap

+131-4
Large diffs are not rendered by default.

test/fixtures/import/import.css

+30
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,33 @@ st.css');
113113
@import url(test.css?#hash);
114114
@import "test.css" supports(display: flex);
115115
@import "test.css" supports(display: flex) screen and (orientation:landscape);
116+
117+
/* Should be one import and two css modules */
118+
119+
@import url('something.css');
120+
@import url('something.css');
121+
122+
/* Should be one import and two css modules */
123+
124+
@import url('something.css?foo=bar');
125+
@import url('something.css?foo=bar');
126+
127+
/* Should be one import and two css modules */
128+
129+
@import url('something.css?foo=bar#hash');
130+
@import url('something.css?foo=bar#hash');
131+
132+
/* Should be two import and two css modules */
133+
134+
@import url('something.css?foo=bar');
135+
@import url('something.css?bar=foo');
136+
137+
/* Should be two import and two css modules */
138+
139+
@import url('something.css?foo=bar#one');
140+
@import url('something.css?foo=bar#two');
141+
142+
/* Should be two import and two css modules */
143+
144+
@import url('something.css?foo=1&bar=2');
145+
@import url('something.css?foo=2&bar=1');

test/fixtures/import/something.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.my-box {
2+
color: red;
3+
}

test/fixtures/url/something.png

76.3 KB
Loading

test/fixtures/url/url.css

+22
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,25 @@ a {
347347
.qqq {
348348
background: url('!!../../helpers/url-loader.js?esModule=false!~package/img.png')
349349
}
350+
351+
.class {
352+
/* Should be one import */
353+
background: url('./something.png');
354+
background: url('./something.png');
355+
356+
background: url('./something.png?foo=bar');
357+
background: url('./something.png?foo=bar');
358+
359+
background: url('./something.png?foo=bar#hash');
360+
background: url('./something.png?foo=bar#hash');
361+
362+
/* Should be two imports */
363+
background: url('./something.png?foo=bar');
364+
background: url('./something.png?bar=foo');
365+
366+
background: url('./something.png?foo=bar#foo');
367+
background: url('./something.png?bar=foo#bar');
368+
369+
background: url('./something.png?foo=1&bar=2');
370+
background: url('./something.png?foo=2&bar=1');
371+
}

0 commit comments

Comments
 (0)