Skip to content

Commit

Permalink
test: imports
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Jul 24, 2020
1 parent 5b45d87 commit a54c955
Show file tree
Hide file tree
Showing 6 changed files with 604 additions and 8 deletions.
422 changes: 418 additions & 4 deletions test/__snapshots__/import-option.test.js.snap

Large diffs are not rendered by default.

135 changes: 131 additions & 4 deletions test/__snapshots__/url-option.test.js.snap

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions test/fixtures/import/import.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,33 @@ st.css');
@import url(test.css?#hash);
@import "test.css" supports(display: flex);
@import "test.css" supports(display: flex) screen and (orientation:landscape);

/* Should be one import and two css modules */

@import url('something.css');
@import url('something.css');

/* Should be one import and two css modules */

@import url('something.css?foo=bar');
@import url('something.css?foo=bar');

/* Should be one import and two css modules */

@import url('something.css?foo=bar#hash');
@import url('something.css?foo=bar#hash');

/* Should be two import and two css modules */

@import url('something.css?foo=bar');
@import url('something.css?bar=foo');

/* Should be two import and two css modules */

@import url('something.css?foo=bar#one');
@import url('something.css?foo=bar#two');

/* Should be two import and two css modules */

@import url('something.css?foo=1&bar=2');
@import url('something.css?foo=2&bar=1');
3 changes: 3 additions & 0 deletions test/fixtures/import/something.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.my-box {
color: red;
}
Binary file added test/fixtures/url/something.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions test/fixtures/url/url.css
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,25 @@ a {
.qqq {
background: url('!!../../helpers/url-loader.js?esModule=false!~package/img.png')
}

.class {
/* Should be one import */
background: url('./something.png');
background: url('./something.png');

background: url('./something.png?foo=bar');
background: url('./something.png?foo=bar');

background: url('./something.png?foo=bar#hash');
background: url('./something.png?foo=bar#hash');

/* Should be two imports */
background: url('./something.png?foo=bar');
background: url('./something.png?bar=foo');

background: url('./something.png?foo=bar#foo');
background: url('./something.png?bar=foo#bar');

background: url('./something.png?foo=1&bar=2');
background: url('./something.png?foo=2&bar=1');
}

0 comments on commit a54c955

Please sign in to comment.