File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ module.exports = function (processors, options) {
1515
1616 stream . _transform = function ( file , encoding , cb ) {
1717
18+ if ( file . isNull ( ) ) {
19+ return cb ( null , file )
20+ }
21+
1822 if ( file . isStream ( ) ) {
1923 return handleError ( 'Streams are not supported!' )
2024 }
Original file line number Diff line number Diff line change @@ -8,6 +8,22 @@ var postcss = require('./index')
88var proxyquire = require ( 'proxyquire' )
99var sinon = require ( 'sinon' )
1010
11+ it ( 'should pass file when it isNull()' , function ( cb ) {
12+ var stream = postcss ( [ doubler ] )
13+ var emptyFile = {
14+ isNull : function ( ) { return true }
15+ }
16+
17+ stream . once ( 'data' , function ( data ) {
18+ assert . equal ( data , emptyFile )
19+ cb ( )
20+ } )
21+
22+ stream . write ( emptyFile )
23+
24+ stream . end ( )
25+ } )
26+
1127it ( 'should transform css with multiple processors' , function ( cb ) {
1228
1329 var stream = postcss (
You can’t perform that action at this time.
0 commit comments