test timeout value modifiable globally with TEST_TIMEOUT env variable
This commit is contained in:
parent
1345516117
commit
8fb28c5cfe
@ -35,5 +35,5 @@ test('uses password file when PGPASSFILE env variable is set', function() {
|
||||
done();
|
||||
pg.end();
|
||||
}))
|
||||
}, 15000));
|
||||
}));
|
||||
});
|
||||
|
@ -24,5 +24,5 @@ test('connection with config ssl = true', function() {
|
||||
done();
|
||||
pg.end();
|
||||
}))
|
||||
}, 15000));
|
||||
}));
|
||||
});
|
@ -133,9 +133,13 @@ assert.lengthIs = function(actual, expectedLength) {
|
||||
|
||||
var expect = function(callback, timeout) {
|
||||
var executed = false;
|
||||
timeout = timeout || 5000;
|
||||
timeout = timeout || parseInt(process.env.TEST_TIMEOUT) || 5000;
|
||||
var id = setTimeout(function() {
|
||||
assert.ok(executed, "Expected execution of function to be fired within " + timeout + ' milliseconds');
|
||||
assert.ok(executed,
|
||||
"Expected execution of function to be fired within " + timeout
|
||||
+ " milliseconds " +
|
||||
+ " (hint: export TEST_TIMEOUT=<timeout in milliseconds>"
|
||||
+ " to change timeout globally)");
|
||||
}, timeout)
|
||||
|
||||
if(callback.length < 3) {
|
||||
|
Loading…
Reference in New Issue
Block a user