Files
babel-tailwind/src/__tests__/tw.test.ts
2024-07-06 19:17:37 -04:00

44 lines
995 B
TypeScript

import { describe, it } from "vitest";
import { getBuild, matchSnapshot } from "./utils";
describe("babel-tailwind", () => {
const compileESBuild = getBuild("tw");
it("supports grouped tw", async () => {
const { files } = await compileESBuild({
clsx: "emotion",
expectFiles: 2,
javascript: `
import { tw } from "@aet/tailwind/macro";
export default tw("text-sm", \`flex\`, {
"group-hover": "text-center",
"[&>div]": \`font-semibold\`,
data: {
"name='hello'": "text-right",
nested: {
true: "border",
}
},
})
`,
});
matchSnapshot(files);
});
it("passes through `group` className", async () => {
const { files } = await compileESBuild({
clsx: "emotion",
expectFiles: 2,
javascript: `
import { tw } from "@aet/tailwind/macro";
export default tw\`group hover:text-center\`;
`,
});
matchSnapshot(files);
});
});