reformat + add testing utils, test dev plugin fully
Some checks failed
/ build (node-16) (push) Successful in 12s
/ build (windows-node-iron) (push) Failing after 1m48s

This commit is contained in:
Soph :3 2025-10-20 11:28:18 +03:00
parent 0259a96937
commit 4d8a9dff8e
15 changed files with 242 additions and 158 deletions

View file

@ -1,7 +1,6 @@
import { expect, test } from "bun:test";
import PostCSS from "../postcss";
// Dummy PostCSS plugin that uppercases all CSS
function uppercasePlugin() {
return {
postcssPlugin: "uppercase",
@ -10,7 +9,7 @@ function uppercasePlugin() {
decl.value = decl.value.toUpperCase();
decl.prop = decl.prop.toUpperCase();
});
}
},
};
}
uppercasePlugin.postcss = true;
@ -30,7 +29,6 @@ test("PostCSS returns unchanged CSS if no plugins", async () => {
});
test("PostCSS handles multiple plugins", async () => {
// Plugin to replace 'red' with 'green'
function replaceRedPlugin() {
return {
postcssPlugin: "replace-red",
@ -38,7 +36,7 @@ test("PostCSS handles multiple plugins", async () => {
root.walkDecls((decl: any) => {
decl.value = decl.value.replace(/red/g, "green");
});
}
},
};
}
replaceRedPlugin.postcss = true;