File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1- .foo {
1+ .is- foo {
22 color : red;
33}
Original file line number Diff line number Diff line change @@ -250,7 +250,9 @@ describe('gulp-csslint', function() {
250250 stream . write ( file ) ;
251251 stream . end ( ) ;
252252 } ) ;
253+ } ) ;
253254
255+ describe ( 'cssLintPlugin.reporter()' , function ( ) {
254256 it ( 'should support built-in CSSLint formatters' , sinon . test ( function ( done ) {
255257 var a = 0 ;
256258
@@ -284,5 +286,39 @@ describe('gulp-csslint', function() {
284286 lintStream . write ( file ) ;
285287 lintStream . end ( ) ;
286288 } ) ) ;
289+
290+ it ( 'should not print empty output by built-in CSSLint formatters' , sinon . test ( function ( done ) {
291+ var a = 0 ;
292+
293+ var file = getFile ( 'fixtures/validCSS.css' ) ;
294+
295+ var lintStream = cssLintPlugin ( ) ;
296+ var reporterStream = cssLintPlugin . reporter ( 'text' ) ;
297+
298+ sinon . stub ( gutil , 'log' ) ;
299+
300+ reporterStream . on ( 'data' , function ( ) {
301+ ++ a ;
302+ } ) ;
303+ lintStream . on ( 'data' , function ( newFile ) {
304+ should . exist ( newFile . csslint . success ) ;
305+ newFile . csslint . success . should . equal ( true ) ;
306+ reporterStream . write ( newFile ) ;
307+ } ) ;
308+ lintStream . once ( 'end' , function ( ) {
309+ reporterStream . end ( ) ;
310+ } ) ;
311+
312+ reporterStream . once ( 'end' , function ( ) {
313+ a . should . equal ( 1 ) ;
314+ sinon . assert . callCount ( gutil . log , 0 ) ;
315+
316+ gutil . log . restore ( ) ;
317+ done ( ) ;
318+ } ) ;
319+
320+ lintStream . write ( file ) ;
321+ lintStream . end ( ) ;
322+ } ) ) ;
287323 } ) ;
288324} ) ;
You can’t perform that action at this time.
0 commit comments