File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 3333 },
3434 "devDependencies" : {
3535 "chai" : " ^3.4.1" ,
36+ "chai-as-promised" : " ^5.2.0" ,
3637 "eslint" : " ^1.10.3" ,
3738 "eslint-config-airbnb" : " ^5.0.0" ,
3839 "mocha" : " ^2.3.4" ,
Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ var rewire = require('rewire');
77var suitcss = rewire ( '../lib' ) ;
88var path = require ( 'path' ) ;
99var sinonChai = require ( 'sinon-chai' ) ;
10+ var chaiAsPromised = require ( 'chai-as-promised' ) ;
1011require ( 'sinon-as-promised' ) ;
1112
1213chai . use ( sinonChai ) ;
14+ chai . use ( chaiAsPromised ) ;
1315var expect = chai . expect ;
1416
1517/**
@@ -152,19 +154,16 @@ describe('suitcss', function() {
152154 } ) ;
153155
154156 describe ( 'stylelint' , function ( ) {
155- it ( 'should throw an error if stylelint fails' , function ( done ) {
156- suitcss ( '@import "./stylelint.css"' , {
157- lint : true ,
158- root : 'test/fixtures' ,
159- 'postcss-reporter' : {
160- throwError : true
161- }
162- } ) . then ( function ( ) {
163- done ( new Error ( 'stylelint should have failed conformance' ) ) ;
164- } ) . catch ( function ( err ) {
165- expect ( err . message ) . to . contain ( 'postcss-reporter: warnings or errors were found' ) ;
166- done ( ) ;
167- } ) ;
157+ it ( 'should throw an error if stylelint fails' , function ( ) {
158+ return expect (
159+ suitcss ( '@import "./stylelint.css"' , {
160+ lint : true ,
161+ root : 'test/fixtures' ,
162+ 'postcss-reporter' : {
163+ throwError : true
164+ }
165+ } )
166+ ) . to . be . rejectedWith ( Error , 'postcss-reporter: warnings or errors were found' ) ;
168167 } ) ;
169168 } ) ;
170169
You can’t perform that action at this time.
0 commit comments