Skip to content

Commit 0e27d41

Browse files
committed
Update tests
1 parent 411dd9c commit 0e27d41

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

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

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { normalizePath } from './utils'
1010
let settings: Settings = {
1111
tailwindCSS: {
1212
files: {
13-
exclude: [],
13+
exclude: ['**/.git/**', '**/node_modules/**', '**/.hg/**', '**/.svn/**'],
1414
},
1515
},
1616
} as any
@@ -115,10 +115,7 @@ testFixture('v4/workspaces', [
115115
{
116116
config: 'packages/admin/app.css',
117117
selectors: [
118-
'{URL}/node_modules/tailwindcss/**',
119-
'{URL}/node_modules/tailwindcss/index.css',
120-
'{URL}/node_modules/tailwindcss/theme.css',
121-
'{URL}/node_modules/tailwindcss/utilities.css',
118+
'{URL}/packages/admin/*',
122119
'{URL}/packages/admin/**',
123120
'{URL}/packages/admin/app.css',
124121
'{URL}/packages/admin/package.json',
@@ -127,15 +124,12 @@ testFixture('v4/workspaces', [
127124
{
128125
config: 'packages/web/app.css',
129126
selectors: [
130-
'{URL}/node_modules/tailwindcss/**',
131-
'{URL}/node_modules/tailwindcss/index.css',
132-
'{URL}/node_modules/tailwindcss/theme.css',
133-
'{URL}/node_modules/tailwindcss/utilities.css',
134127
'{URL}/packages/style-export/**',
135128
'{URL}/packages/style-export/lib.css',
136129
'{URL}/packages/style-export/theme.css',
137130
'{URL}/packages/style-main-field/**',
138131
'{URL}/packages/style-main-field/lib.css',
132+
'{URL}/packages/web/*',
139133
'{URL}/packages/web/**',
140134
'{URL}/packages/web/app.css',
141135
'{URL}/packages/web/package.json',
@@ -148,28 +142,24 @@ testFixture('v4/auto-content', [
148142
{
149143
config: 'src/app.css',
150144
content: [
145+
'{URL}/*',
151146
'{URL}/package.json',
152147
'{URL}/src/index.html',
153148
'{URL}/src/components/example.html',
154-
'{URL}/src/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
149+
'{URL}/src/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
155150
],
156151
},
157152
])
158153

159154
testFixture('v4/auto-content-split', [
160-
//
161-
{
162-
// TODO: This should _probably_ not be present
163-
config: 'node_modules/tailwindcss/index.css',
164-
content: [],
165-
},
166155
{
167156
config: 'src/app.css',
168157
content: [
158+
'{URL}/*',
169159
'{URL}/package.json',
170160
'{URL}/src/index.html',
171161
'{URL}/src/components/example.html',
172-
'{URL}/src/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
162+
'{URL}/src/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
173163
],
174164
},
175165
])
@@ -179,23 +169,23 @@ testFixture('v4/custom-source', [
179169
{
180170
config: 'admin/app.css',
181171
content: [
182-
'{URL}/admin/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
183-
'{URL}/admin/**/*.bin',
172+
'{URL}/*',
184173
'{URL}/admin/foo.bin',
174+
'{URL}/admin/{**/*.bin,**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}}',
185175
'{URL}/package.json',
186176
'{URL}/shared.html',
187-
'{URL}/web/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
177+
'{URL}/web/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
188178
],
189179
},
190180
{
191181
config: 'web/app.css',
192182
content: [
193-
'{URL}/admin/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
194-
'{URL}/web/*.bin',
195-
'{URL}/web/bar.bin',
183+
'{URL}/*',
184+
'{URL}/admin/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
196185
'{URL}/package.json',
197186
'{URL}/shared.html',
198-
'{URL}/web/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
187+
'{URL}/web/bar.bin',
188+
'{URL}/web/{**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue},*.bin}',
199189
],
200190
},
201191
])
@@ -204,7 +194,7 @@ testFixture('v4/missing-files', [
204194
//
205195
{
206196
config: 'app.css',
207-
content: ['{URL}/package.json'],
197+
content: ['{URL}/*', '{URL}/package.json'],
208198
},
209199
])
210200

@@ -213,8 +203,9 @@ testFixture('v4/path-mappings', [
213203
{
214204
config: 'app.css',
215205
content: [
206+
'{URL}/*',
216207
'{URL}/package.json',
217-
'{URL}/src/**/*.{py,tpl,js,vue,php,mjs,cts,jsx,tsx,rhtml,slim,handlebars,twig,rs,njk,svelte,liquid,pug,md,ts,heex,mts,astro,nunjucks,rb,eex,haml,cjs,html,hbs,jade,aspx,razor,erb,mustache,mdx}',
208+
'{URL}/src/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
218209
'{URL}/src/a/my-config.ts',
219210
'{URL}/src/a/my-plugin.ts',
220211
'{URL}/tsconfig.json',
@@ -226,7 +217,7 @@ testFixture('v4/invalid-import-order', [
226217
//
227218
{
228219
config: 'tailwind.css',
229-
content: ['{URL}/package.json'],
220+
content: ['{URL}/*', '{URL}/package.json'],
230221
},
231222
])
232223

0 commit comments

Comments
 (0)