Skip to content

Commit

Permalink
increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Oct 18, 2024
1 parent 85cbf39 commit f80515b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin-packs/postcss-bundler/test/_tape.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const testCases = {
message: 'errors on mismatched charset',
exception: /Incompatible @charset statements/,
},
'conditional-layer-before-external': {
message: 'correctly handles conditional stylesheets containing layer statements before external resources',
},
'does-not-exist-1': {
message: 'throws on files that don\'t exist',
exception: /Failed to find 'imports\/does-not-exist.css'/,
Expand All @@ -27,6 +30,9 @@ const testCases = {
message: 'ignores incorrect syntax',
warnings: 4,
},
'layer-before-external': {
message: 'correctly handles layer statements before external resources',
},
'regexp': {
message: 'regexp sanity checks',
warnings: 2,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "imports/layer-before-external.css" (min-width: 300px);
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* imports/layer-before-external.css */

@import 'data:text/css;base64,QGxheWVyIHJlc2V0LCBib290c3RyYXA=' (min-width: 300px);

@import 'data:text/css;base64,QGltcG9ydCB1cmwoJ2h0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9ucG0vYm9vdHN0cmFwQDUuMy4wL2Rpc3QvY3NzL2Jvb3RzdHJhcC5jc3MnKSAobWluLXdpZHRoOiAzMDBweCk=' layer(bootstrap);

@media (min-width: 300px){

@layer reset {
h1 {
margin-top: 100px;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@layer reset, bootstrap;
@import url('https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.css') layer(bootstrap);

@layer reset {
h1 {
margin-top: 100px;
}
}
8 changes: 8 additions & 0 deletions plugin-packs/postcss-bundler/test/layer-before-external.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@layer reset, bootstrap;
@import url('https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.css') layer(bootstrap);

@layer reset {
h1 {
margin-top: 100px;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@layer reset, bootstrap;
@import url('https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.css') layer(bootstrap);
@layer reset {
h1 {
margin-top: 100px;
}
}

0 comments on commit f80515b

Please sign in to comment.