@@ -96,11 +96,42 @@ describe(`web worker CSS Language tests`, async function () {
9696 * zeroUnits: "warning"
9797 * emptyRules: "warning"
9898 * unknownProperties: "warning"
99+ * ieHack: "warning"
99100 * // leave default
100101 * importStatement: none
101102 * boxModel: none
102103 */
103104
105+ it ( "should validate css ieHack" , async function ( ) {
106+ const cssValidationData = await ( await fetch ( "test-files/cssValidationData.json" ) ) . json ( ) ;
107+ messageFromWorker = null ;
108+ const text = `.myClass {
109+ color: blue; /* For modern browsers */
110+ _color: red; /* This color is only for IE 6 and below */
111+ }` ;
112+ worker . postMessage ( {
113+ command : `validateCSS` , text, cssMode : "CSS" , filePath : "file:///c.css" , lintSettings : {
114+ ieHack : "warning"
115+ }
116+ } ) ;
117+ let output = await waitForWorkerMessage ( `validateCSS` , 1000 ) ;
118+ const symbols = output . diag ;
119+ expect ( symbols ) . to . deep . equal ( cssValidationData [ "ieHack" ] ) ;
120+ } ) ;
121+
122+ it ( "should validate css ieHack by default" , async function ( ) {
123+ messageFromWorker = null ;
124+ const text = `.myClass {
125+ color: blue; /* For modern browsers */
126+ _color: red; /* This color is only for IE 6 and below */
127+ }` ;
128+ worker . postMessage ( {
129+ command : `validateCSS` , text, cssMode : "CSS" , filePath : "file:///c.css" } ) ;
130+ let output = await waitForWorkerMessage ( `validateCSS` , 1000 ) ;
131+ const symbols = output . diag ;
132+ expect ( symbols ) . to . deep . equal ( [ ] ) ;
133+ } ) ;
134+
104135 it ( "should validate css unknownProperties" , async function ( ) {
105136 const cssValidationData = await ( await fetch ( "test-files/cssValidationData.json" ) ) . json ( ) ;
106137 messageFromWorker = null ;
0 commit comments