Skip to content

Commit 75b198e

Browse files
committed
Add test for negative sources
1 parent 537b23d commit 75b198e

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

packages/tailwindcss-language-server/src/project-locator.test.ts

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ testLocator({
147147
'package.json': json`
148148
{
149149
"dependencies": {
150-
"tailwindcss": "^4.0.15",
151-
"@tailwindcss/oxide": "^4.0.15"
150+
"tailwindcss": "0.0.0-insiders.3e53e25",
151+
"@tailwindcss/oxide": "0.0.0-insiders.3e53e25"
152152
}
153153
}
154154
`,
@@ -178,8 +178,8 @@ testLocator({
178178
'package.json': json`
179179
{
180180
"dependencies": {
181-
"tailwindcss": "^4.0.15",
182-
"@tailwindcss/oxide": "^4.0.15"
181+
"tailwindcss": "0.0.0-insiders.3e53e25",
182+
"@tailwindcss/oxide": "0.0.0-insiders.3e53e25"
183183
}
184184
}
185185
`,
@@ -211,8 +211,8 @@ testLocator({
211211
'package.json': json`
212212
{
213213
"dependencies": {
214-
"tailwindcss": "^4.0.15",
215-
"@tailwindcss/oxide": "^4.0.15"
214+
"tailwindcss": "0.0.0-insiders.3e53e25",
215+
"@tailwindcss/oxide": "0.0.0-insiders.3e53e25"
216216
}
217217
}
218218
`,
@@ -265,6 +265,40 @@ testLocator({
265265
],
266266
})
267267

268+
testLocator({
269+
// TODO: Enable once v4.1 is released
270+
options: { skip: true },
271+
name: 'automatic content detection with negative custom sources',
272+
fs: {
273+
'package.json': json`
274+
{
275+
"dependencies": {
276+
"tailwindcss": "0.0.0-insiders.3e53e25",
277+
"@tailwindcss/oxide": "0.0.0-insiders.3e53e25"
278+
}
279+
}
280+
`,
281+
'src/app.css': css`
282+
@import 'tailwindcss';
283+
@source './**/*.html';
284+
@source not './ignored.html';
285+
`,
286+
'src/index.html': html`<div class="underline"></div>`,
287+
'src/ignored.html': html`<div class="flex"></div>`,
288+
},
289+
expected: [
290+
{
291+
config: '/src/app.css',
292+
content: [
293+
'/*',
294+
'/package.json',
295+
'/src/index.html',
296+
'/src/{**/*.html,**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}}',
297+
],
298+
},
299+
],
300+
})
301+
268302
testFixture('v4/missing-files', [
269303
//
270304
{

0 commit comments

Comments
 (0)