Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for issue 65 #99

Closed
wants to merge 2 commits into from

2 participants

@bergmark

--timeout now controls how long runFile waits for tests to be added in that test file.

@bergmark

Had to add the runFiles change to assure that directories don't cause a timeout.

@breerly

heres a link: #65

@bergmark bergmark closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 26, 2011
  1. --timeout now controls how long runFile waits for tests to be added i…

    Raevel authored
    …n that test file.
  2. run now only calls runFiles with files.

    Raevel authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 bin/expresso
View
11 bin/expresso
@@ -657,8 +657,11 @@ function run(files) {
cursor(false);
if (!files.length) {
try {
- files = fs.readdirSync('test').map(function(file){
- return 'test/' + file;
+ files = [];
+ fs.readdirSync('test').map(function(file){
+ if (fs.lstatSync('test/' + file).isFile()) {
+ files.push('test/' + file);
+ }
});
} catch (err) {
print('\n failed to load tests in [bold]{./test}\n');
@@ -710,6 +713,9 @@ function runFiles(files) {
*/
function runFile(file, fn) {
+ var fileTimeout = setTimeout(function () {
+ throw new Error("Timeout while waiting for tests to be added in file " + file);
+ }, timeout);
if (file.match(file_matcher)) {
var title = path.basename(file),
file = path.join(cwd, file),
@@ -717,6 +723,7 @@ function runFile(file, fn) {
(function check(){
var len = Object.keys(mod).length;
if (len) {
+ clearTimeout(fileTimeout);
runSuite(title, mod, fn);
} else {
setTimeout(check, 20);
Something went wrong with that request. Please try again.