@@ -42,27 +42,99 @@ describe('flags warnings with invalid scss', () => {
4242 assert . equal ( result . errored , true ) ;
4343 } ) ;
4444
45- it ( 'flags one warning ' , ( ) => {
46- assert . equal ( result . results [ 0 ] . warnings . length , 1 ) ;
45+ it ( 'flags four warnings ' , ( ) => {
46+ assert . equal ( result . results [ 0 ] . warnings . length , 4 ) ;
4747 } ) ;
4848
49- it ( 'correct warning text' , ( ) => {
50- assert . equal ( result . results [ 0 ] . warnings [ 0 ] . text , 'Expected variable to be kebab-case' ) ;
49+ it ( 'correct warning text (function name)' , ( ) => {
50+ assert . equal (
51+ result . results [ 0 ] . warnings [ 0 ] . text ,
52+ 'Expected function name "FOO" to be kebab-case (scss/at-function-pattern)' ,
53+ ) ;
5154 } ) ;
5255
53- it ( 'correct rule flagged' , ( ) => {
54- assert . equal ( result . results [ 0 ] . warnings [ 0 ] . rule , 'scss/dollar-variable -pattern' ) ;
56+ it ( 'correct rule flagged (function name) ' , ( ) => {
57+ assert . equal ( result . results [ 0 ] . warnings [ 0 ] . rule , 'scss/at-function -pattern' ) ;
5558 } ) ;
5659
57- it ( 'correct severity flagged' , ( ) => {
60+ it ( 'correct severity flagged (function name) ' , ( ) => {
5861 assert . equal ( result . results [ 0 ] . warnings [ 0 ] . severity , 'error' ) ;
5962 } ) ;
6063
61- it ( 'correct line number' , ( ) => {
62- assert . equal ( result . results [ 0 ] . warnings [ 0 ] . line , 1 ) ;
64+ it ( 'correct line number (function name) ' , ( ) => {
65+ assert . equal ( result . results [ 0 ] . warnings [ 0 ] . line , 7 ) ;
6366 } ) ;
6467
65- it ( 'correct column number' , ( ) => {
66- assert . equal ( result . results [ 0 ] . warnings [ 0 ] . column , 1 ) ;
68+ it ( 'correct column number (function name)' , ( ) => {
69+ assert . equal ( result . results [ 0 ] . warnings [ 0 ] . column , 11 ) ;
70+ } ) ;
71+
72+ it ( 'correct warning text (mixin name)' , ( ) => {
73+ assert . equal (
74+ result . results [ 0 ] . warnings [ 1 ] . text ,
75+ 'Expected mixin name "FOO" to be kebab-case (scss/at-mixin-pattern)' ,
76+ ) ;
77+ } ) ;
78+
79+ it ( 'correct rule flagged (mixin name)' , ( ) => {
80+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . rule , 'scss/at-mixin-pattern' ) ;
81+ } ) ;
82+
83+ it ( 'correct severity flagged (mixin name)' , ( ) => {
84+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . severity , 'error' ) ;
85+ } ) ;
86+
87+ it ( 'correct line number (mixin name)' , ( ) => {
88+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . line , 11 ) ;
89+ } ) ;
90+
91+ it ( 'correct column number (mixin name)' , ( ) => {
92+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . column , 8 ) ;
93+ } ) ;
94+
95+ it ( 'correct warning text (variable name)' , ( ) => {
96+ assert . equal (
97+ result . results [ 0 ] . warnings [ 2 ] . text ,
98+ 'Expected variable name "FOO" to be kebab-case (scss/dollar-variable-pattern)' ,
99+ ) ;
100+ } ) ;
101+
102+ it ( 'correct rule flagged (variable name)' , ( ) => {
103+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . rule , 'scss/dollar-variable-pattern' ) ;
104+ } ) ;
105+
106+ it ( 'correct severity flagged (variable name)' , ( ) => {
107+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . severity , 'error' ) ;
108+ } ) ;
109+
110+ it ( 'correct line number (variable name)' , ( ) => {
111+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . line , 1 ) ;
112+ } ) ;
113+
114+ it ( 'correct column number (variable name)' , ( ) => {
115+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . column , 1 ) ;
116+ } ) ;
117+
118+ it ( 'correct warning text (placeholder name)' , ( ) => {
119+ assert . equal (
120+ result . results [ 0 ] . warnings [ 3 ] . text ,
121+ 'Expected placeholder name "FOO" to be kebab-case (scss/percent-placeholder-pattern)' ,
122+ ) ;
123+ } ) ;
124+
125+ it ( 'correct rule flagged (placeholder name)' , ( ) => {
126+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . rule , 'scss/percent-placeholder-pattern' ) ;
127+ } ) ;
128+
129+ it ( 'correct severity flagged (placeholder name)' , ( ) => {
130+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . severity , 'error' ) ;
131+ } ) ;
132+
133+ it ( 'correct line number (placeholder name)' , ( ) => {
134+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . line , 3 ) ;
135+ } ) ;
136+
137+ it ( 'correct column number (placeholder name)' , ( ) => {
138+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . column , 1 ) ;
67139 } ) ;
68140} ) ;
0 commit comments