File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1717 "dependencies" : {
1818 "stylelint-config-property-sort-order-smacss" : " ^5.0.0" ,
1919 "stylelint-config-standard" : " ^18.3.0" ,
20- "stylelint-order" : " ^3.0.0" ,
2120 "stylelint-scss" : " ^3.9.0"
2221 },
2322 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -4,13 +4,26 @@ const assert = require('assert').strict
44
55const config = require ( '../index.js' )
66
7- test ( 'stylelint configuration ' , async ( ) => {
7+ test ( 'declaration-block-single-line-max-declarations (stylelint-config-standard) ' , async ( ) => {
88 const output = await stylelint . lint ( {
9- code : " a { color: red; top: 0 ; }" ,
9+ code : ' a { top: 0; color: red ; }\n' ,
1010 config,
1111 } )
1212
13+ assert . strictEqual ( output . results [ 0 ] . warnings . length , 1 )
14+ assert . strictEqual ( output . results [ 0 ] . warnings [ 0 ] . text . trim ( ) , 'Expected no more than 1 declaration (declaration-block-single-line-max-declarations)' )
15+ } )
16+
17+ test ( 'order/properties-order (stylelint-config-property-sort-order-smacss)' , async ( ) => {
18+ const output = await stylelint . lint ( {
19+ code :
20+ 'a {\n' +
21+ ' color: red;\n' +
22+ ' top: 0;\n' +
23+ '}\n' ,
24+ config,
25+ } )
26+
27+ assert . strictEqual ( output . results [ 0 ] . warnings . length , 1 )
1328 assert . strictEqual ( output . results [ 0 ] . warnings [ 0 ] . text . trim ( ) , 'Expected "top" to come before "color" (order/properties-order)' )
14- assert . strictEqual ( output . results [ 0 ] . warnings [ 1 ] . text . trim ( ) , 'Expected no more than 1 declaration (declaration-block-single-line-max-declarations)' )
15- assert . strictEqual ( output . results [ 0 ] . warnings [ 2 ] . text . trim ( ) , 'Unexpected missing end-of-source newline (no-missing-end-of-source-newline)' )
1629} )
You can’t perform that action at this time.
0 commit comments