Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js')
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js
new file mode 100644
index 0000000000..b3fc632a0d
--- /dev/null
+++ b/tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js
@@ -0,0 +1,79 @@
+'use strict';
+
+describe('timeouts', function () {
+ beforeEach(function (done) {
+ // uncomment
+ // setTimeout(done, 3000);
+ done();
+ });
+
+ it('should error on timeout', function (done) {
+ // uncomment
+ // setTimeout(done, 3000);
+ done();
+ });
+
+ it('should allow overriding per-test', function (done) {
+ this.timeout(1000);
+ setTimeout(function () {
+ done();
+ }, 300);
+ });
+
+ describe('disabling', function () {
+ it('should allow overriding per-test', function (done) {
+ this.enableTimeouts(false);
+ this.timeout(1);
+ setTimeout(done, 2);
+ });
+
+ it('should work with timeout(0)', function (done) {
+ this.timeout(0);
+ setTimeout(done, 1);
+ });
+
+ describe('using beforeEach', function () {
+ beforeEach(function () {
+ this.timeout(0);
+ });
+
+ it('should work with timeout(0)', function (done) {
+ setTimeout(done, 1);
+ });
+ });
+
+ describe('using before', function () {
+ before(function () {
+ this.timeout(0);
+ });
+
+ it('should work with timeout(0)', function (done) {
+ setTimeout(done, 1);
+ });
+ });
+
+ describe('using enableTimeouts(false)', function () {
+ this.timeout(4);
+
+ it('should suppress timeout(4)', function (done) {
+ // The test is in the before() call.
+ this.enableTimeouts(false);
+ setTimeout(done, 50);
+ });
+ });
+
+ describe('suite-level', function () {
+ this.timeout(0);
+
+ it('should work with timeout(0)', function (done) {
+ setTimeout(done, 1);
+ });
+
+ describe('nested suite', function () {
+ it('should work with timeout(0)', function (done) {
+ setTimeout(done, 1);
+ });
+ });
+ });
+ });
+});