File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 includePaths : includes ,
3333 imagePath : imagePath ,
3434 outputStyle : outputStyle ,
35- success : function ( css ) {
35+ success : function handleSuccess ( css ) {
3636 // replace contents
3737 file . contents = new Buffer ( css ) ;
3838 // rename file extension
3939 files [ path . join ( outputDir , path . basename ( filename ) . replace ( '.scss' , '.css' ) ) ] = file ;
4040 delete files [ filename ] ;
4141 done ( ) ;
4242 } ,
43- error : function ( err ) {
43+ error : function handleError ( err ) {
44+ if ( typeof err === 'string' ) {
45+ err = new Error ( err ) ;
46+ }
4447 done ( err ) ;
4548 }
4649 } ) ;
Original file line number Diff line number Diff line change 105105 } ) ;
106106 } ) ;
107107
108- it ( 'should fail when invalid file provided ' , function ( done ) {
108+ it ( 'should correctly report errors to Metalsmith ' , function ( done ) {
109109 metalsmith ( __dirname )
110110 . source ( 'fixtures/invalid/src' )
111111 . destination ( 'fixtures/invalid/build' )
112112 . use ( sass ( {
113113 outputStyle : 'expanded'
114114 } ) )
115115 . build ( function ( err ) {
116- assert . notEqual ( err , null , "Error should be set." ) ;
116+ assert ( err . message && / a n i n v a l i d r u l e / . test ( err . message ) ) ;
117117 assert ( ! exists ( join ( __dirname , 'fixtures/invalid/build/invalid.scss' ) ) ) ;
118118 done ( ) ;
119119 } ) ;
You can’t perform that action at this time.
0 commit comments