File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ function mergeOptions(options) {
104104 // Allow additional plugins to be merged with the defaults
105105 // but remove any duplicates so that it respects the new order
106106 if ( ! isEmpty ( options . use ) ) {
107- var dedupedPlugins = difference ( merged . use , options . use ) ;
108- merged . use = dedupedPlugins . concat ( options . use ) ;
107+ var plugins = difference ( merged . use , options . use ) ;
108+ merged . use = plugins . concat ( options . use ) ;
109109 }
110110
111111 return merged ;
@@ -119,7 +119,7 @@ function mergeOptions(options) {
119119 * @returns {Function } Used by postcss-import transform
120120 */
121121function lintImportedFiles ( options ) {
122- return function ( css , filename ) {
122+ return function ( css , filename ) {
123123 return postcss ( [
124124 bemLinter ( options [ 'postcss-bem-linter' ] ) ,
125125 reporter ( options [ 'postcss-reporter' ] )
Original file line number Diff line number Diff line change @@ -145,7 +145,18 @@ describe('suitcss', function () {
145145 beforeLint : beforeLintStub
146146 } ) . catch ( done ) ;
147147
148- expect ( bemLintStub . getCall ( 0 ) . args [ 0 ] ) . to . equal ( '/* before lint */' ) ;
148+ expect ( bemLintStub . args [ 0 ] [ 0 ] ) . to . equal ( '/* before lint */' ) ;
149+
150+ done ( ) ;
151+ } ) ;
152+
153+ it ( 'should pass the merged options to the beforeLint function' , function ( done ) {
154+ suitcss ( read ( 'fixtures/component' ) , {
155+ root : 'test/fixtures' ,
156+ beforeLint : beforeLintStub
157+ } ) . catch ( done ) ;
158+
159+ expect ( beforeLintStub . args [ 0 ] [ 2 ] . root ) . to . equal ( 'test/fixtures' ) ;
149160
150161 done ( ) ;
151162 } ) ;
You can’t perform that action at this time.
0 commit comments