Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add hidden dot files to test suite #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions bin/expresso
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright(c) TJ Holowaychuk <[email protected]>
* (MIT Licensed)
*/

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -41,13 +41,13 @@ var testcount = 0;
/**
* Whitelist of tests to run.
*/

var only = [];

/**
* Boring output.
*/

var boring = false;

/**
Expand Down Expand Up @@ -504,11 +504,11 @@ function reportCoverage(cov) {
*/

function populateCoverage(cov) {
cov.LOC =
cov.LOC =
cov.SLOC =
cov.totalFiles =
cov.totalHits =
cov.totalMisses =
cov.totalMisses =
cov.coverage = 0;
for (var name in cov) {
var file = cov[name];
Expand Down Expand Up @@ -554,7 +554,7 @@ function coverage(data, val) {
for (var i = 0, len = data.length; i < len; ++i) {
if (data[i] !== undefined && data[i] == val) ++n;
}
return n;
return n;
}

/**
Expand All @@ -568,6 +568,13 @@ function run(files) {
try {
files = fs.readdirSync('test').map(function(file){
return 'test/' + file;
}).filter(function(file){

if (file.match(/(^\.)|(\/\.)/) != null) {
return false;
}

return true;
});
} catch (err) {
print('\n failed to load tests in [bold]{./test}\n');
Expand Down Expand Up @@ -703,7 +710,7 @@ function runSuite(title, tests) {

// Setup
var setup = tests.setup || function(fn){ fn(); };

// Iterate tests
(function next(){
if (keys.length) {
Expand Down Expand Up @@ -734,7 +741,7 @@ function runSuite(title, tests) {
clearTimeout(id);
next();
});
}
}
});
} else {
test(assert, function(fn){
Expand Down