Skip to content

Commit 035101e

Browse files
committed
add failing test
1 parent 965048c commit 035101e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/tailwindcss/src/index.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,6 +2514,26 @@ describe('@custom-variant', () => {
25142514
).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: \`@custom-variant\` cannot be nested.]`)
25152515
})
25162516

2517+
test('@custom-variant must not have an empty selector', () => {
2518+
return expect(
2519+
compileCss(css`
2520+
@custom-variant foo ();
2521+
`),
2522+
).rejects.toThrowErrorMatchingInlineSnapshot(
2523+
`[Error: \`@custom-variant foo ()\` selector is invalid.]`,
2524+
)
2525+
})
2526+
2527+
test('@custom-variant with multiple selectors, cannot be empty', () => {
2528+
return expect(
2529+
compileCss(css`
2530+
@custom-variant foo (.foo, .bar, );
2531+
`),
2532+
).rejects.toThrowErrorMatchingInlineSnapshot(
2533+
`[Error: \`@custom-variant foo (.foo, .bar, )\` selector is invalid.]`,
2534+
)
2535+
})
2536+
25172537
test('@custom-variant with no body must include a selector', () => {
25182538
return expect(
25192539
compileCss(css`

0 commit comments

Comments
 (0)