Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

reduce noise about slow tests; make a few tests faster, etc.

Christopher Hiller43501a24ab4e
diff --git a/Makefile b/Makefile
index 1724d30e..7b2bd1e6 100644
--- a/Makefile
+++ b/Makefile
@@ -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:
diff --git a/test/integration/fixtures/options/delay.fixture.js b/test/integration/fixtures/options/delay.fixture.js
index b2d49217..b16db659 100644
--- a/test/integration/fixtures/options/delay.fixture.js
+++ b/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 () {
diff --git a/test/integration/fixtures/retries/async.fixture.js b/test/integration/fixtures/retries/async.fixture.js
index 56d067fc..48dda978 100644
--- a/test/integration/fixtures/retries/async.fixture.js
+++ b/test/integration/fixtures/retries/async.fixture.js
@@ -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) {
diff --git a/test/integration/options.spec.js b/test/integration/options.spec.js
index dbd7acbe..15a46ebf 100644
--- a/test/integration/options.spec.js
+++ b/test/integration/options.spec.js
@@ -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]] : [];
diff --git a/test/integration/regression.spec.js b/test/integration/regression.spec.js
index 14a1a164..537da6ae 100644
--- a/test/integration/regression.spec.js
+++ b/test/integration/regression.spec.js
@@ -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);
diff --git a/test/unit/duration.spec.js b/test/unit/duration.spec.js
index 0194d440..45d2681b 100644
--- a/test/unit/duration.spec.js
+++ b/test/unit/duration.spec.js
@@ -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);
diff --git a/test/unit/timeout.spec.js b/test/unit/timeout.spec.js
index b3fc632a..066e70d1 100644
--- a/test/unit/timeout.spec.js
+++ b/test/unit/timeout.spec.js
@@ -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 () {
@@ -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);