@@ -101,10 +101,10 @@ describe(`web worker CSS Language tests`, async function () {
101
101
* important: none
102
102
*/
103
103
104
- const CSS_MODES = [ "CSS" ] ;
104
+ const CSS_MODES = [ "CSS" , "LESS" , "SCSS" ] ;
105
105
for ( let css of CSS_MODES ) {
106
- it ( " should validate css unknownVendorSpecificProperties" , async function ( ) {
107
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
106
+ it ( ` should validate ${ css } unknownVendorSpecificProperties` , async function ( ) {
107
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
108
108
messageFromWorker = null ;
109
109
const text = `div {
110
110
-microsoft-border-radius: 5px;
@@ -119,8 +119,8 @@ describe(`web worker CSS Language tests`, async function () {
119
119
expect ( symbols ) . to . deep . equal ( cssValidationData [ "unknownVendorSpecificProperties" ] ) ;
120
120
} ) ;
121
121
122
- it ( " should validate css fontFaceProperties" , async function ( ) {
123
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
122
+ it ( ` should validate ${ css } fontFaceProperties` , async function ( ) {
123
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
124
124
messageFromWorker = null ;
125
125
const text = `@font-face {
126
126
font-family: 'MyFont';
@@ -135,8 +135,8 @@ describe(`web worker CSS Language tests`, async function () {
135
135
expect ( symbols ) . to . deep . equal ( cssValidationData [ "fontFaceProperties" ] ) ;
136
136
} ) ;
137
137
138
- it ( " should validate css fontFaceProperties by default" , async function ( ) {
139
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
138
+ it ( ` should validate ${ css } fontFaceProperties by default` , async function ( ) {
139
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
140
140
messageFromWorker = null ;
141
141
const text = `@font-face {
142
142
font-family: 'MyFont';
@@ -148,7 +148,7 @@ describe(`web worker CSS Language tests`, async function () {
148
148
expect ( symbols ) . to . deep . equal ( cssValidationData [ "fontFaceProperties" ] ) ;
149
149
} ) ;
150
150
151
- it ( " should not validate css important by default" , async function ( ) {
151
+ it ( ` should not validate ${ css } important by default` , async function ( ) {
152
152
messageFromWorker = null ;
153
153
const text = `.element {
154
154
width: 0 !important;
@@ -161,8 +161,8 @@ describe(`web worker CSS Language tests`, async function () {
161
161
expect ( symbols ) . to . deep . equal ( [ ] ) ;
162
162
} ) ;
163
163
164
- it ( " should validate css propertyIgnoredDueToDisplay" , async function ( ) {
165
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
164
+ it ( ` should validate ${ css } propertyIgnoredDueToDisplay` , async function ( ) {
165
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
166
166
messageFromWorker = null ;
167
167
const text = `.element {
168
168
display: inline-block;
@@ -178,8 +178,8 @@ describe(`web worker CSS Language tests`, async function () {
178
178
expect ( symbols ) . to . deep . equal ( cssValidationData [ "propertyIgnoredDueToDisplay" ] ) ;
179
179
} ) ;
180
180
181
- it ( " should validate css propertyIgnoredDueToDisplay by default" , async function ( ) {
182
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
181
+ it ( ` should validate ${ css } propertyIgnoredDueToDisplay by default` , async function ( ) {
182
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
183
183
messageFromWorker = null ;
184
184
const text = `.element {
185
185
display: inline-block;
@@ -192,8 +192,8 @@ describe(`web worker CSS Language tests`, async function () {
192
192
expect ( symbols ) . to . deep . equal ( cssValidationData [ "propertyIgnoredDueToDisplay" ] ) ;
193
193
} ) ;
194
194
195
- it ( " should validate css ieHack" , async function ( ) {
196
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
195
+ it ( ` should validate ${ css } ieHack` , async function ( ) {
196
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
197
197
messageFromWorker = null ;
198
198
const text = `.myClass {
199
199
color: blue; /* For modern browsers */
@@ -209,7 +209,7 @@ describe(`web worker CSS Language tests`, async function () {
209
209
expect ( symbols ) . to . deep . equal ( cssValidationData [ "ieHack" ] ) ;
210
210
} ) ;
211
211
212
- it ( " should validate css ieHack by default" , async function ( ) {
212
+ it ( ` should validate ${ css } ieHack by default` , async function ( ) {
213
213
messageFromWorker = null ;
214
214
const text = `.myClass {
215
215
color: blue; /* For modern browsers */
@@ -222,8 +222,8 @@ describe(`web worker CSS Language tests`, async function () {
222
222
expect ( symbols ) . to . deep . equal ( [ ] ) ;
223
223
} ) ;
224
224
225
- it ( " should validate css unknownProperties" , async function ( ) {
226
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
225
+ it ( ` should validate ${ css } unknownProperties` , async function ( ) {
226
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
227
227
messageFromWorker = null ;
228
228
const text = `.box {
229
229
doesntExist: 300px;
@@ -238,8 +238,8 @@ describe(`web worker CSS Language tests`, async function () {
238
238
expect ( symbols ) . to . deep . equal ( cssValidationData [ "unknownProperties" ] ) ;
239
239
} ) ;
240
240
241
- it ( " should validate css unknownProperties by default" , async function ( ) {
242
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
241
+ it ( ` should validate ${ css } unknownProperties by default` , async function ( ) {
242
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
243
243
messageFromWorker = null ;
244
244
const text = `.box {
245
245
doesntExist: 300px;
@@ -251,8 +251,8 @@ describe(`web worker CSS Language tests`, async function () {
251
251
expect ( symbols ) . to . deep . equal ( cssValidationData [ "unknownProperties" ] ) ;
252
252
} ) ;
253
253
254
- it ( " should validate css boxModel" , async function ( ) {
255
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
254
+ it ( ` should validate ${ css } boxModel` , async function ( ) {
255
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
256
256
messageFromWorker = null ;
257
257
const text = `.box {
258
258
width: 300px;
@@ -269,7 +269,7 @@ describe(`web worker CSS Language tests`, async function () {
269
269
expect ( symbols ) . to . deep . equal ( cssValidationData [ "boxModel" ] ) ;
270
270
} ) ;
271
271
272
- it ( " should not validate css boxModel by default" , async function ( ) {
272
+ it ( ` should not validate ${ css } boxModel by default` , async function ( ) {
273
273
messageFromWorker = null ;
274
274
const text = `.box {
275
275
width: 300px;
@@ -283,8 +283,8 @@ describe(`web worker CSS Language tests`, async function () {
283
283
expect ( symbols ) . to . deep . equal ( [ ] ) ;
284
284
} ) ;
285
285
286
- it ( " should validate css zeroUnits" , async function ( ) {
287
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
286
+ it ( ` should validate ${ css } zeroUnits` , async function ( ) {
287
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
288
288
messageFromWorker = null ;
289
289
const text = `.box { width: 0px;}` ;
290
290
worker . postMessage ( {
@@ -297,7 +297,7 @@ describe(`web worker CSS Language tests`, async function () {
297
297
expect ( symbols ) . to . deep . equal ( cssValidationData [ "zeroUnits" ] ) ;
298
298
} ) ;
299
299
300
- it ( " should not validate css zeroUnits by default" , async function ( ) {
300
+ it ( ` should not validate ${ css } zeroUnits by default` , async function ( ) {
301
301
messageFromWorker = null ;
302
302
const text = `.box { width: 0px;}` ;
303
303
worker . postMessage ( { command : `validateCSS` , text, cssMode : css , filePath : `file:///c.${ css } ` } ) ;
@@ -306,8 +306,8 @@ describe(`web worker CSS Language tests`, async function () {
306
306
expect ( symbols ) . to . deep . equal ( [ ] ) ;
307
307
} ) ;
308
308
309
- it ( " should validate css duplicateProperties" , async function ( ) {
310
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
309
+ it ( ` should validate ${ css } duplicateProperties` , async function ( ) {
310
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
311
311
messageFromWorker = null ;
312
312
const text = `.box { color: red; color: blue; }` ;
313
313
worker . postMessage ( {
@@ -320,7 +320,7 @@ describe(`web worker CSS Language tests`, async function () {
320
320
expect ( symbols ) . to . deep . equal ( cssValidationData [ "duplicateProperties" ] ) ;
321
321
} ) ;
322
322
323
- it ( " should not validate css duplicateProperties by default" , async function ( ) {
323
+ it ( ` should not validate ${ css } duplicateProperties by default` , async function ( ) {
324
324
messageFromWorker = null ;
325
325
const text = `.box { color: red; color: blue; }` ;
326
326
worker . postMessage ( {
@@ -330,8 +330,8 @@ describe(`web worker CSS Language tests`, async function () {
330
330
expect ( symbols ) . to . deep . equal ( [ ] ) ;
331
331
} ) ;
332
332
333
- it ( " should validate css importStatement" , async function ( ) {
334
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
333
+ it ( ` should validate ${ css } importStatement` , async function ( ) {
334
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
335
335
messageFromWorker = null ;
336
336
const text = `@import "a.css"` ;
337
337
worker . postMessage ( { command : `validateCSS` , text, cssMode : css , filePath : `file:///c.${ css } ` , lintSettings : {
@@ -342,7 +342,7 @@ describe(`web worker CSS Language tests`, async function () {
342
342
expect ( symbols ) . to . deep . equal ( cssValidationData [ "importStatement" ] ) ;
343
343
} ) ;
344
344
345
- it ( " should not validate css importStatement by default" , async function ( ) {
345
+ it ( ` should not validate ${ css } importStatement by default` , async function ( ) {
346
346
messageFromWorker = null ;
347
347
const text = `@import "a.css"` ;
348
348
worker . postMessage ( { command : `validateCSS` , text, cssMode : css , filePath : `file:///c.${ css } ` } ) ;
@@ -351,8 +351,8 @@ describe(`web worker CSS Language tests`, async function () {
351
351
expect ( symbols ) . to . deep . equal ( [ ] ) ;
352
352
} ) ;
353
353
354
- it ( " should validate css emptyRules" , async function ( ) {
355
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
354
+ it ( ` should validate ${ css } emptyRules` , async function ( ) {
355
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
356
356
messageFromWorker = null ;
357
357
const text = `.box {}` ;
358
358
worker . postMessage ( { command : `validateCSS` , text, cssMode : css , filePath : `file:///c.${ css } ` , lintSettings : {
@@ -362,8 +362,8 @@ describe(`web worker CSS Language tests`, async function () {
362
362
const symbols = output . diag ;
363
363
expect ( symbols ) . to . deep . equal ( cssValidationData [ "emptyRules" ] ) ;
364
364
} ) ;
365
- it ( " should validate css emptyRules by default" , async function ( ) {
366
- const cssValidationData = await ( await fetch ( " test-files/cssValidationData .json" ) ) . json ( ) ;
365
+ it ( ` should validate ${ css } emptyRules by default` , async function ( ) {
366
+ const cssValidationData = await ( await fetch ( ` test-files/${ css } ValidationData .json` ) ) . json ( ) ;
367
367
messageFromWorker = null ;
368
368
const text = `.box {}` ;
369
369
worker . postMessage ( { command : `validateCSS` , text, cssMode : css , filePath : `file:///c.${ css } ` } ) ;
@@ -375,7 +375,7 @@ describe(`web worker CSS Language tests`, async function () {
375
375
}
376
376
377
377
it ( "should validate less emptyRules by default" , async function ( ) {
378
- const cssValidationData = await ( await fetch ( "test-files/cssValidationData .json" ) ) . json ( ) ;
378
+ const cssValidationData = await ( await fetch ( "test-files/CSSValidationData .json" ) ) . json ( ) ;
379
379
messageFromWorker = null ;
380
380
const text = `// less supports comments\n.box {}` ;
381
381
worker . postMessage ( { command : `validateCSS` , text, cssMode : "LESS" , filePath : "file:///c.less" } ) ;
@@ -385,7 +385,7 @@ describe(`web worker CSS Language tests`, async function () {
385
385
} ) ;
386
386
387
387
it ( "should validate scss emptyRules by default" , async function ( ) {
388
- const cssValidationData = await ( await fetch ( "test-files/cssValidationData .json" ) ) . json ( ) ;
388
+ const cssValidationData = await ( await fetch ( "test-files/CSSValidationData .json" ) ) . json ( ) ;
389
389
messageFromWorker = null ;
390
390
const text = `// less supports comments\n.box {}` ;
391
391
worker . postMessage ( { command : `validateCSS` , text, cssMode : "SCSS" , filePath : "file:///c.scss" } ) ;
0 commit comments