feat: add native TailwindCSS plugin (#2056)

This commit is contained in:
Marvin Hagemeister
2023-11-21 17:22:18 +01:00
committed by GitHub
parent daf15aee6f
commit 93e4b7e9b7
29 changed files with 454 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
import { runBuild, withFakeServe } from "$fresh/tests/test_utils.ts";
import { assertStringIncludes } from "$std/assert/mod.ts";
Deno.test("TailwindCSS - dev mode", async () => {
await withFakeServe("./tests/fixture_tailwind/dev.ts", async (server) => {
const res = await server.get("/styles.css");
const content = await res.text();
assertStringIncludes(content, ".text-red-600");
}, { loadConfig: true });
});
Deno.test("TailwindCSS - build mode", async () => {
await runBuild("./tests/fixture_tailwind/dev.ts");
await withFakeServe("./tests/fixture_tailwind/main.ts", async (server) => {
const res = await server.get("/styles.css");
const content = await res.text();
assertStringIncludes(content, ".text-red-600");
}, { loadConfig: true });
});
Deno.test("TailwindCSS - config", async () => {
await withFakeServe(
"./tests/fixture_tailwind_config/dev.ts",
async (server) => {
const res = await server.get("/styles.css");
const content = await res.text();
assertStringIncludes(content, ".text-pp");
},
{ loadConfig: true },
);
});