Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Jan 29, 2025
1 parent 965048c commit 035101e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,26 @@ describe('@custom-variant', () => {
).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: \`@custom-variant\` cannot be nested.]`)
})

test('@custom-variant must not have an empty selector', () => {
return expect(
compileCss(css`
@custom-variant foo ();
`),
).rejects.toThrowErrorMatchingInlineSnapshot(
`[Error: \`@custom-variant foo ()\` selector is invalid.]`,
)
})

test('@custom-variant with multiple selectors, cannot be empty', () => {
return expect(
compileCss(css`
@custom-variant foo (.foo, .bar, );
`),
).rejects.toThrowErrorMatchingInlineSnapshot(
`[Error: \`@custom-variant foo (.foo, .bar, )\` selector is invalid.]`,
)
})

test('@custom-variant with no body must include a selector', () => {
return expect(
compileCss(css`
Expand Down

0 comments on commit 035101e

Please sign in to comment.