@@ -22,32 +22,16 @@ describe('stylelint-webpack-plugin', function () {
2222 } ) ;
2323 } ) ;
2424
25- it ( 'sends errors properly ' , function ( ) {
25+ it ( 'sends errors to the errors output only ' , function ( ) {
2626 var config = {
2727 context : './test/fixtures/test3' ,
2828 entry : './index'
2929 } ;
3030
3131 return pack ( assign ( { } , baseConfig , config ) )
3232 . then ( function ( stats ) {
33- expect ( stats . compilation . errors ) . to . have . length ( 1 ) ;
34- } ) ;
35- } ) ;
36-
37- it . skip ( 'fails when .stylelintrc is not a proper format' , function ( ) {
38- var badConfigFilePath = getPath ( './.badstylelintrc' ) ;
39- var config = {
40- entry : './index' ,
41- plugins : [
42- new StyleLintPlugin ( {
43- configFile : badConfigFilePath
44- } )
45- ]
46- } ;
47-
48- return pack ( assign ( { } , baseConfig , config ) )
49- . then ( function ( stats ) {
50- expect ( stats . compilation . errors ) . to . have . length ( 0 ) ;
33+ expect ( stats . compilation . errors ) . to . have . length ( 1 , 'should have one error' ) ;
34+ expect ( stats . compilation . warnings ) . to . have . length ( 0 , 'should have no warnings' ) ;
5135 } ) ;
5236 } ) ;
5337
@@ -84,19 +68,14 @@ describe('stylelint-webpack-plugin', function () {
8468
8569 it ( 'sends warnings properly' , function ( ) {
8670 var config = {
87- context : './test/fixtures/test8' ,
88- entry : './index' ,
89- plugins : [
90- new StyleLintPlugin ( {
91- quiet : true ,
92- configFile : configFilePath
93- } )
94- ]
71+ context : './test/fixtures/rule-warning' ,
72+ entry : './index'
9573 } ;
9674
9775 return pack ( assign ( { } , baseConfig , config ) )
9876 . then ( function ( stats ) {
9977 expect ( stats . compilation . warnings ) . to . have . length ( 1 ) ;
78+ expect ( stats . compilation . errors ) . to . have . length ( 0 ) ;
10079 } ) ;
10180 } ) ;
10281
@@ -116,9 +95,9 @@ describe('stylelint-webpack-plugin', function () {
11695 } ) ;
11796 } ) ;
11897
119- it ( 'send messages to console when css file with errors and quiet props set to false' , function ( ) {
98+ it ( 'sends messages to console when css file with errors and quiet props set to false' , function ( ) {
12099 var config = {
121- context : './test/fixtures/test10 ' ,
100+ context : './test/fixtures/syntax-error ' ,
122101 entry : './index' ,
123102 plugins : [
124103 new StyleLintPlugin ( {
@@ -129,7 +108,7 @@ describe('stylelint-webpack-plugin', function () {
129108
130109 return pack ( assign ( { } , baseConfig , config ) )
131110 . then ( function ( stats ) {
132- expect ( stats . compilation . warnings ) . to . have . length ( 1 ) ;
111+ expect ( stats . compilation . warnings ) . to . have . length ( 0 ) ;
133112 expect ( stats . compilation . errors ) . to . have . length ( 1 ) ;
134113 } ) ;
135114 } ) ;
@@ -174,4 +153,21 @@ describe('stylelint-webpack-plugin', function () {
174153 } ) ;
175154 } ) ;
176155 } ) ;
156+
157+ it . skip ( 'fails when .stylelintrc is not a proper format' , function ( ) {
158+ var badConfigFilePath = getPath ( './.badstylelintrc' ) ;
159+ var config = {
160+ entry : './index' ,
161+ plugins : [
162+ new StyleLintPlugin ( {
163+ configFile : badConfigFilePath
164+ } )
165+ ]
166+ } ;
167+
168+ return pack ( assign ( { } , baseConfig , config ) )
169+ . then ( function ( stats ) {
170+ expect ( stats . compilation . errors ) . to . have . length ( 0 ) ;
171+ } ) ;
172+ } ) ;
177173} ) ;
0 commit comments