Skip to content

Commit 7cd643a

Browse files
committed
updated tests
1 parent 30c0bac commit 7cd643a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

test/index.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const { dependencies } = JSON.parse(fs.readFileSync(new URL("../package.json", i
3232
assert.strictEqual(style.includes(`.bg-image-relative{background-image:url("./assets/background-updated.jpg");`), true, "relative asset paths should be updated.");
3333
assert.strictEqual(style.includes(`.bg-image-absolute{background-image:url("/assets/background.jpg");}`), true, "absolute asset paths should not be updated.");
3434
assert.strictEqual(fs.existsSync("test/dist/assets/background-updated.jpg"), true, "asset files should be copied to output folder");
35+
assert.strictEqual(style.includes(`@theme inline{--radius-sm:calc(var(--radius) - 4px);@keyframes spinner{0%{opacity:1;}to{opacity:0.15;}}}`), true, "nested css should not disrupt minification.");
36+
assert.strictEqual(style.includes(`/* this is a comment */`), false, "comments should be removed");
3537

3638
fs.rmSync(path.resolve("test/dist/index.js"));
3739
fs.rmSync(path.resolve("test/dist/index.css"));

test/src/index.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
box-shadow: 0px 16px 32px -10px rgba(17, 24, 38, 0.1);
33
}
44

5+
/* this is a comment */
56
.another-element {
67
background: red;
78
}
@@ -28,4 +29,13 @@ html[style*="--color-scheme: dark"] {
2829

2930
.bg-image-absolute {
3031
background-image: url("/assets/background.jpg");
32+
}
33+
34+
@theme inline {
35+
--radius-sm: calc(var(--radius) - 4px);
36+
37+
@keyframes spinner {
38+
0% { opacity: 1; }
39+
to { opacity: 0.15; }
40+
}
3141
}

0 commit comments

Comments
 (0)