import { describe, expect, it } from "vitest"; import { getBuild } from "./__tests__/utils"; import { getClassName } from "./index"; describe("babel-tailwind", () => { const compileESBuild = getBuild("main"); it("supports ESBuild", async () => { const { files } = await compileESBuild({ clsx: "emotion", expectFiles: 2, javascript: /* tsx */ ` export function Hello() { return (
Hello, world!
); } `, }); const clsName = getClassName("text-center"); expect(files.js.text).toContain(`className: "${clsName}"`); expect(files.css.text).toMatch(`.${clsName} {\n text-align: center;\n}`); }); });