@@ -197,77 +197,6 @@ describe('suitcss', function() {
197197 ) . to . be . rejectedWith ( Error , 'postcss-reporter: warnings or errors were found' ) ;
198198 } ) ;
199199 } ) ;
200-
201- describe ( 'transforming css before linting' , function ( ) {
202- describe ( 'ensuring functions are called correctly' , function ( ) {
203- var lintImportedFilesStub , beforeLintStub , revert ;
204-
205- beforeEach ( function ( ) {
206- var postcssPromise = sinon . stub ( ) . resolves ( '/*linting done*/' ) ( ) ;
207- lintImportedFilesStub = sinon . stub ( ) . returns ( postcssPromise ) ;
208- beforeLintStub = sinon . stub ( ) . returns ( '/*before lint*/' ) ;
209- revert = suitcss . __set__ ( 'lintImportedFiles' , lintImportedFilesStub ) ;
210- } ) ;
211-
212- afterEach ( function ( ) {
213- revert ( ) ;
214- } ) ;
215-
216- it ( 'should call `beforeLint` function before linting' , function ( done ) {
217- suitcss ( read ( 'fixtures/component' ) , {
218- root : 'test/fixtures' ,
219- beforeLint : beforeLintStub
220- } )
221- . then ( function ( ) {
222- expect ( beforeLintStub ) . to . be . calledOnce ;
223- expect ( lintImportedFilesStub ) . to . be . calledOnce ;
224- expect ( beforeLintStub ) . to . have . been . calledBefore ( lintImportedFilesStub ) ;
225- done ( ) ;
226- } )
227- . catch ( done ) ;
228- } ) ;
229-
230- it ( 'should pass the result of `beforeLint` to `lintImportedFiles`' , function ( done ) {
231- suitcss ( read ( 'fixtures/component' ) , {
232- root : 'test/fixtures' ,
233- beforeLint : beforeLintStub
234- } )
235- . then ( function ( ) {
236- expect ( lintImportedFilesStub . args [ 0 ] [ 1 ] ) . to . equal ( '/*before lint*/' ) ;
237- done ( ) ;
238- } )
239- . catch ( done ) ;
240- } ) ;
241-
242- it ( 'should pass the options object to the beforeLint function as the third parameter' , function ( done ) {
243- suitcss ( read ( 'fixtures/component' ) , {
244- root : 'test/fixtures' ,
245- beforeLint : beforeLintStub
246- } )
247- . then ( function ( ) {
248- expect ( beforeLintStub . args [ 0 ] [ 2 ] ) . to . contain ( { root : 'test/fixtures' } ) ;
249- done ( ) ;
250- } )
251- . catch ( done ) ;
252- } ) ;
253- } ) ;
254-
255- describe ( 'outputting transformed css' , function ( ) {
256- it ( 'should use the CSS returned from beforeLint' , function ( done ) {
257- suitcss ( read ( 'fixtures/import' ) , {
258- root : 'test/fixtures' ,
259- beforeLint : function ( ) {
260- return 'body {}' ;
261- }
262- } )
263- . then ( function ( result ) {
264- expect ( result . css ) . to . equal ( 'body {}\n' ) ;
265- done ( ) ;
266- } )
267- . catch ( done ) ;
268- } ) ;
269- } ) ;
270- } ) ;
271200 } ) ;
272201} ) ;
273202
@@ -338,7 +267,6 @@ describe('cli', function() {
338267 var testChild = exec ( 'node bin/suitcss -c test/noautoprefixer.config.js' , function ( err , stdout ) {
339268 if ( err ) return done ( err ) ;
340269 expect ( stdout ) . to . equal ( output ) ;
341- expect ( stdout ) . to . not . contain ( 'beforeLint ran' ) ;
342270 done ( ) ;
343271 } ) ;
344272
@@ -350,18 +278,16 @@ describe('cli', function() {
350278 exec ( 'node bin/suitcss -v -c test/noautoprefixer.config.js test/fixtures/cli/input.css test/fixtures/cli/output.css' , function ( err , stdout ) {
351279 if ( err ) return done ( err ) ;
352280 expect ( stdout ) . to . contain ( 'write' ) ;
353- expect ( stdout ) . to . not . contain ( 'beforeLint ran' ) ;
354281 done ( ) ;
355282 } ) ;
356283 } ) ;
357284
358285 it ( 'should allow configurable import root' , function ( done ) {
359- exec ( 'node bin/suitcss -i test/fixtures -c test/noautoprefixer.config.js test/fixtures/import.css test/fixtures/cli/output.css' , function ( err , stdout ) {
286+ exec ( 'node bin/suitcss -i test/fixtures -c test/noautoprefixer.config.js test/fixtures/import.css test/fixtures/cli/output.css' , function ( err ) {
360287 if ( err ) return done ( err ) ;
361288 var res = read ( 'fixtures/cli/output' ) ;
362289 var expected = read ( 'fixtures/component.out' ) ;
363290 expect ( res ) . to . equal ( expected ) ;
364- expect ( stdout ) . to . not . contain ( 'beforeLint ran' ) ;
365291 done ( ) ;
366292 } ) ;
367293 } ) ;
@@ -375,22 +301,20 @@ describe('cli', function() {
375301 } ) ;
376302
377303 it ( 'should minify the output' , function ( done ) {
378- exec ( 'node bin/suitcss -i test/fixtures -c test/noautoprefixer.config.js test/fixtures/import.css test/fixtures/cli/output.css -m' , function ( err , stdout ) {
304+ exec ( 'node bin/suitcss -i test/fixtures -c test/noautoprefixer.config.js test/fixtures/import.css test/fixtures/cli/output.css -m' , function ( err ) {
379305 if ( err ) return done ( err ) ;
380306 var res = read ( 'fixtures/cli/output' ) ;
381307 var expected = read ( 'fixtures/minify.out' ) ;
382- expect ( stdout ) . to . not . contain ( 'beforeLint ran' ) ;
383308 expect ( res ) . to . equal ( expected ) ;
384309 done ( ) ;
385310 } ) ;
386311 } ) ;
387312
388313 it ( 'should allow a config file to be passed' , function ( done ) {
389- exec ( 'node bin/suitcss -i test/fixtures -c test/test.config.js test/fixtures/config.css test/fixtures/cli/output.css' , function ( err , stdout ) {
314+ exec ( 'node bin/suitcss -i test/fixtures -c test/test.config.js test/fixtures/config.css test/fixtures/cli/output.css' , function ( err ) {
390315 if ( err ) return done ( err ) ;
391316 var res = read ( 'fixtures/cli/output' ) ;
392317 var expected = read ( 'fixtures/config.out' ) ;
393- expect ( stdout ) . to . contain ( 'beforeLint ran' ) ;
394318 expect ( res ) . to . equal ( expected ) ;
395319 done ( ) ;
396320 } ) ;
0 commit comments