jasmine-node icon indicating copy to clipboard operation
jasmine-node copied to clipboard

afterEach not called if defaultTimeoutInterval reached in beforeEach

Open kprantis opened this issue 11 years ago • 0 comments

afterEach does not appear to be called if a beforeEach fails out due to reaching the defaultTimeoutInterval limit. afterEach is often used to cleanup after a test before starting the next test and/or to gather information useful to debug failures, so it seems reasonable to me that this should still be executing.

More specifics on our case: Our tests have a beforeEach and afterEach. The beforeEach sets up for the test, the afterEach gathers some extra information on what the state was at the end of the test for us to use in debugging failures. Due to the app under test legitly taking too long to execute, we hit the defaultTimeoutInterval during the beforeEach, and were surprised to find our afterEach was not executed at all, which we confirmed by having a console.log() at the start of the afterEach to note when it executes .

kprantis avatar Feb 25 '14 21:02 kprantis