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/integration/fixtures/regression/issue-1417.js')
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js
new file mode 100644
index 0000000000..13ce053784
--- /dev/null
+++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js
@@ -0,0 +1,22 @@
+'use strict';
+
+/**
+ * This file should generate only one failure per spec for the thrown error.
+ * It should not report misleading 'multiple calls to done()'.
+ */
+
+it('fails exactly once when a global error is thrown synchronously and done errors', function (done) {
+ setTimeout(function () {
+ done(new Error('test error'));
+ }, 1); // Not 0 - it will 'succeed', but won't test the breaking condition
+
+ throw new Error('sync error');
+});
+
+it('fails exactly once when a global error is thrown synchronously and done completes', function (done) {
+ setTimeout(function () {
+ done();
+ }, 1); // Not 0 - it will 'succeed', but won't test the breaking condition
+
+ throw new Error('sync error');
+});