In some cases, installing a test environment in hooks like beforeEach can take considerable time. For example, here's a test script.
describe('case', function() { beforeEach(function(done) { setTimeout(done, 2500); }); it('should do something', function(done) { // ... setTimeout(done, 100); }); }); Fails with an error
1) case "before each" hook for "should do something":
Error: timeout of 2000ms exceeded. Ensure the done () callback is being called in this test.
Obviously, the problem is not in the test "should do something" but in the beforeEach hook.
The official documentation says that you can set timeouts for test cases / cases ( it / describe ). But this is not quite the right way, since the time limit on test scenarios should remain the same.
Is it possible to set a separate timeout for the hook, but so that the timeout for test cases and cases ( it and describe blocks) remains the same?