Skip to content

Commit

Permalink
improve comments for test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Bucaran authored and notslang committed Jan 19, 2015
1 parent dfed0e1 commit a24215d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/runner.js
@@ -1,20 +1,24 @@

/**
* Module dependencies.
*/

var stylus = require('stylus'),
nib = require('../'),
fs = require('fs');

// test cases

/**
* Read test/cases directory and filter all `.styl` files, then remove
* this extension for each file in the collection and prepare to test.
*/
var cases = fs.readdirSync('test/cases').filter(function(file){
return ~file.indexOf('.styl');
return ~file.indexOf('.styl'); // bitwise flip to treat result as truthy.
}).map(function(file){
return file.replace('.styl', '');
});

/*
* For each `.styl` and `.css` pair in `test/cases`, compile stylus to css
* and compare actual result to expected css.
*/
describe('integration', function(){
cases.forEach(function(test){
var name = test.replace(/[-.]/g, ' ');
Expand Down

0 comments on commit a24215d

Please sign in to comment.