@@ -3,7 +3,7 @@ const stylelint = require("stylelint");
3
3
4
4
const randomOrder = require ( "../index.js" ) ;
5
5
const [ fixture , expected ] = [ "test/fixture.css" , "test/expected.css" ] ;
6
- const intentionalwrong = 3 ;
6
+ const intentionalWrong = 1 ;
7
7
8
8
const runStylelint = async ( css ) => {
9
9
const { results } = await stylelint . lint ( {
@@ -13,31 +13,26 @@ const runStylelint = async (css) => {
13
13
return results [ 0 ] ;
14
14
} ;
15
15
16
- describe ( "Code lint complement " , ( ) => {
16
+ describe ( "Code lint plus " , ( ) => {
17
17
it ( "no repeat properties" , ( ) => {
18
- const props = [ ] ;
18
+ const properties = [ ] ;
19
19
for ( const groups of randomOrder . rules [ "order/properties-order" ] ) {
20
- props . push ( ...groups . properties ) ;
20
+ properties . push ( ...groups . properties ) ;
21
21
}
22
- assert . equal ( new Set ( props ) . size , props . length ) ;
22
+ assert . equal ( new Set ( properties ) . size , properties . length ) ;
23
23
} ) ;
24
24
} ) ;
25
25
26
26
// stylelint test/*.css --config index.js --max-warnings 0
27
27
describe ( "Code test" , ( ) => {
28
28
it ( "with incorrect order" , async ( ) => {
29
29
const results = await runStylelint ( fixture ) ;
30
- assert . ok ( results . errored ) ;
31
- assert . equal ( results . warnings . length , intentionalwrong ) ;
32
- assert . equal (
33
- results . warnings [ 0 ] . text . trim ( ) ,
34
- `Expected "display" to come before "box-sizing" (order/properties-order)`
35
- ) ;
30
+ assert . equal ( results . warnings . length , intentionalWrong ) ;
31
+ console . log ( results . warnings ) ;
36
32
} ) ;
37
33
38
34
it ( "with correct order" , async ( ) => {
39
35
const results = await runStylelint ( expected ) ;
40
- assert . ok ( ! results . errored ) ;
41
36
assert . equal ( results . warnings . length , 0 ) ;
42
37
} ) ;
43
38
} ) ;
0 commit comments