@@ -172,7 +172,8 @@ describe('suitcss', function() {
172172 var lintImportedFilesStub , beforeLintStub , revert ;
173173
174174 beforeEach ( function ( ) {
175- lintImportedFilesStub = sinon . stub ( ) . returns ( '/*linting done*/' ) ;
175+ var postcssPromise = sinon . stub ( ) . resolves ( '/*linting done*/' ) ( ) ;
176+ lintImportedFilesStub = sinon . stub ( ) . returns ( postcssPromise ) ;
176177 beforeLintStub = sinon . stub ( ) . returns ( '/*before lint*/' ) ;
177178 revert = suitcss . __set__ ( 'lintImportedFiles' , lintImportedFilesStub ) ;
178179 } ) ;
@@ -185,35 +186,38 @@ describe('suitcss', function() {
185186 suitcss ( read ( 'fixtures/component' ) , {
186187 root : 'test/fixtures' ,
187188 beforeLint : beforeLintStub
188- } ) . catch ( done ) ;
189-
190- expect ( lintImportedFilesStub ) . to . be . calledOnce ;
191- expect ( beforeLintStub ) . to . be . calledOnce ;
192- expect ( beforeLintStub ) . to . have . been . calledBefore ( lintImportedFilesStub ) ;
193-
194- done ( ) ;
189+ } )
190+ . then ( function ( ) {
191+ expect ( beforeLintStub ) . to . be . calledOnce ;
192+ expect ( lintImportedFilesStub ) . to . be . calledOnce ;
193+ expect ( beforeLintStub ) . to . have . been . calledBefore ( lintImportedFilesStub ) ;
194+ done ( ) ;
195+ } )
196+ . catch ( done ) ;
195197 } ) ;
196198
197199 it ( 'should pass the result of `beforeLint` to `lintImportedFiles`' , function ( done ) {
198200 suitcss ( read ( 'fixtures/component' ) , {
199201 root : 'test/fixtures' ,
200202 beforeLint : beforeLintStub
201- } ) . catch ( done ) ;
202-
203- expect ( lintImportedFilesStub . args [ 0 ] [ 1 ] ) . to . equal ( '/*before lint*/' ) ;
204-
205- done ( ) ;
203+ } )
204+ . then ( function ( ) {
205+ expect ( lintImportedFilesStub . args [ 0 ] [ 1 ] ) . to . equal ( '/*before lint*/' ) ;
206+ done ( ) ;
207+ } )
208+ . catch ( done ) ;
206209 } ) ;
207210
208211 it ( 'should pass the options object to the beforeLint function as the third parameter' , function ( done ) {
209212 suitcss ( read ( 'fixtures/component' ) , {
210213 root : 'test/fixtures' ,
211214 beforeLint : beforeLintStub
212- } ) . catch ( done ) ;
213-
214- expect ( beforeLintStub . args [ 0 ] [ 2 ] ) . to . contain ( { root : 'test/fixtures' } ) ;
215-
216- done ( ) ;
215+ } )
216+ . then ( function ( ) {
217+ expect ( beforeLintStub . args [ 0 ] [ 2 ] ) . to . contain ( { root : 'test/fixtures' } ) ;
218+ done ( ) ;
219+ } )
220+ . catch ( done ) ;
217221 } ) ;
218222 } ) ;
219223 } ) ;
0 commit comments