Skip to content

Commit ef8bcf4

Browse files
committed
Update tests
1 parent 61dd148 commit ef8bcf4

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/tailwindcss-language-server/src/language/rewriting.test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
import { describe, expect, test } from 'vitest'
22
import { rewriteCss } from './rewriting'
3-
import dedent from 'dedent'
43

5-
// TODO: Remove once the bundled CSS language service is updated
6-
test('@layer statements are removed', () => {
4+
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/1457
5+
test('@layer statements inside comments do not break', () => {
76
let input = [
87
//
9-
'@layer theme, base, components, utilities;',
10-
'@import "tailwindcss";',
8+
'/* @layer',
9+
'*/',
10+
'@import "./path/to/a/file.css";',
11+
'',
12+
'@source "./**/*.{ts,tsx}";',
1113
]
1214

1315
let output = [
1416
//
15-
'', // wrong
16-
'@import "tailwindcss" ;',
17+
'/* @layer',
18+
'*/',
19+
'@import "./path/to/a/file.css" ;', // wrong
20+
'',
21+
'@source "./**/*.{ts,tsx}";',
1722
]
1823

1924
expect(rewriteCss(input.join('\n'))).toBe(output.join('\n'))
@@ -31,7 +36,7 @@ test('@layer blocks', () => {
3136

3237
let output = [
3338
//
34-
'@media(℘) {',
39+
'@layer utilities {',
3540
' .foo {',
3641
' color: red;',
3742
' }',

0 commit comments

Comments
 (0)