Skip to content

Commit

Permalink
reduce noise about slow tests; make a few tests faster, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Oct 1, 2017
1 parent fa228e9 commit 43501a2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -70,7 +70,7 @@ test-unit:

test-integration:
@printf "==> [Test :: Integrations]\n"
$(call test_node,integration) --timeout 5000 \
$(call test_node,integration) --timeout 5000 --slow 500 \
test/integration/*.spec.js

test-compilers:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures/options/delay.fixture.js
@@ -1,7 +1,7 @@
'use strict';

var assert = require('assert');
var delay = 500;
var delay = 200;

setTimeout(function () {
describe('delayed execution', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures/retries/async.fixture.js
Expand Up @@ -19,7 +19,7 @@ describe('retries', function () {
});

it('should allow override and run appropriate hooks', function (done) {
this.timeout(200);
this.timeout(100);
this.retries(2);
console.log('TEST', times);
if (++times < 3) {
Expand Down
1 change: 1 addition & 0 deletions test/integration/options.spec.js
Expand Up @@ -349,6 +349,7 @@ describe('options', function () {
var runExit = function (shouldExit, behavior) {
return function (done) {
this.timeout(0);
this.slow(3000);
var didExit = true;
var t;
var args = behaviors[behavior] ? [behaviors[behavior]] : [];
Expand Down
1 change: 1 addition & 0 deletions test/integration/regression.spec.js
Expand Up @@ -52,6 +52,7 @@ describe('regressions', function () {
// on a modern MBP takes ±5 seconds on node 4.0, but on older laptops with node 0.12 ±40 seconds.
// Could easily take longer on even weaker machines (Travis-CI containers for example).
this.timeout(120000);
this.slow(12000);
run('regression/issue-1991.fixture.js', [], function (err, res) {
if (err) {
done(err);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/duration.spec.js
Expand Up @@ -18,7 +18,7 @@ describe('durations', function () {
});

describe('when fast', function () {
it('should highlight in green', function (done) {
it('should not highlight', function (done) {
setTimeout(function () {
done();
}, 10);
Expand Down
5 changes: 3 additions & 2 deletions test/unit/timeout.spec.js
Expand Up @@ -14,10 +14,10 @@ describe('timeouts', function () {
});

it('should allow overriding per-test', function (done) {
this.timeout(1000);
this.timeout(200);
setTimeout(function () {
done();
}, 300);
}, 50);
});

describe('disabling', function () {
Expand Down Expand Up @@ -56,6 +56,7 @@ describe('timeouts', function () {
this.timeout(4);

it('should suppress timeout(4)', function (done) {
this.slow(100);
// The test is in the before() call.
this.enableTimeouts(false);
setTimeout(done, 50);
Expand Down

0 comments on commit 43501a2

Please sign in to comment.