@@ -42,27 +42,96 @@ 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' ,
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 ( result . results [ 0 ] . warnings [ 1 ] . text , 'Expected mixin name "FOO" to be kebab-case' ) ;
74+ } ) ;
75+
76+ it ( 'correct rule flagged (mixin name)' , ( ) => {
77+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . rule , 'scss/at-mixin-pattern' ) ;
78+ } ) ;
79+
80+ it ( 'correct severity flagged (mixin name)' , ( ) => {
81+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . severity , 'error' ) ;
82+ } ) ;
83+
84+ it ( 'correct line number (mixin name)' , ( ) => {
85+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . line , 11 ) ;
86+ } ) ;
87+
88+ it ( 'correct column number (mixin name)' , ( ) => {
89+ assert . equal ( result . results [ 0 ] . warnings [ 1 ] . column , 8 ) ;
90+ } ) ;
91+
92+ it ( 'correct warning text (variable name)' , ( ) => {
93+ assert . equal (
94+ result . results [ 0 ] . warnings [ 2 ] . text ,
95+ 'Expected variable name "FOO" to be kebab-case' ,
96+ ) ;
97+ } ) ;
98+
99+ it ( 'correct rule flagged (variable name)' , ( ) => {
100+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . rule , 'scss/dollar-variable-pattern' ) ;
101+ } ) ;
102+
103+ it ( 'correct severity flagged (variable name)' , ( ) => {
104+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . severity , 'error' ) ;
105+ } ) ;
106+
107+ it ( 'correct line number (variable name)' , ( ) => {
108+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . line , 1 ) ;
109+ } ) ;
110+
111+ it ( 'correct column number (variable name)' , ( ) => {
112+ assert . equal ( result . results [ 0 ] . warnings [ 2 ] . column , 1 ) ;
113+ } ) ;
114+
115+ it ( 'correct warning text (placeholder name)' , ( ) => {
116+ assert . equal (
117+ result . results [ 0 ] . warnings [ 3 ] . text ,
118+ 'Expected placeholder name "FOO" to be kebab-case' ,
119+ ) ;
120+ } ) ;
121+
122+ it ( 'correct rule flagged (placeholder name)' , ( ) => {
123+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . rule , 'scss/percent-placeholder-pattern' ) ;
124+ } ) ;
125+
126+ it ( 'correct severity flagged (placeholder name)' , ( ) => {
127+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . severity , 'error' ) ;
128+ } ) ;
129+
130+ it ( 'correct line number (placeholder name)' , ( ) => {
131+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . line , 3 ) ;
132+ } ) ;
133+
134+ it ( 'correct column number (placeholder name)' , ( ) => {
135+ assert . equal ( result . results [ 0 ] . warnings [ 3 ] . column , 1 ) ;
67136 } ) ;
68137} ) ;
0 commit comments