Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Oct 24, 2024
1 parent 5ce4bd5 commit 380c128
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ it('should not migrate already migrated `@import` at-rules', async () => {
).toMatchInlineSnapshot(`"@import 'tailwindcss';"`)
})

it('should add missing `layer(…)` to imported files', async () => {
expect(
await migrate(css`
@import 'tailwindcss/utilities'; /* Expected no layer */
@import './foo.css'; /* Expected layer(utilities) */
@import './bar.css'; /* Expected layer(utilities) */
@import 'tailwindcss/components'; /* Expected no layer */
`),
).toMatchInlineSnapshot(`
"@import 'tailwindcss/utilities'; /* Expected no layer */
@import './foo.css' layer(utilities); /* Expected layer(utilities) */
@import './bar.css' layer(utilities); /* Expected layer(utilities) */
@import 'tailwindcss/components'; /* Expected no layer */"
`)
})

it('should not migrate anything if no `@tailwind` directives (or imports) are found', async () => {
expect(
await migrate(css`
Expand Down

0 comments on commit 380c128

Please sign in to comment.