From ad0a5b32c0b72fb76dbbcca647ec506c8980f580 Mon Sep 17 00:00:00 2001 From: Tundzhay Mollov Date: Sun, 31 May 2020 19:47:55 +0300 Subject: [PATCH] Fix for Issue #1866 https://github.com/javascript-tutorial/en.javascript.info/issues/1866 --- .../05-testing-mocha/beforeafter.view/test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/1-js/03-code-quality/05-testing-mocha/beforeafter.view/test.js b/1-js/03-code-quality/05-testing-mocha/beforeafter.view/test.js index cad51d3e..d3de8254 100644 --- a/1-js/03-code-quality/05-testing-mocha/beforeafter.view/test.js +++ b/1-js/03-code-quality/05-testing-mocha/beforeafter.view/test.js @@ -1,5 +1,11 @@ describe("test", function() { + + // Mocha usually waits for the tests for 2 seconds before considering them wrong + + this.timeout(200000); // With this code we increase this - in this case to 200,000 milliseconds + // This is because of the "alert" function, because if you delay pressing the "OK" button the tests will not pass! + before(() => alert("Testing started – before all tests")); after(() => alert("Testing finished – after all tests"));