karma-fixture
karma-fixture copied to clipboard
Auto-cleanup
I was caught off-guard by some tests randomly failing. I tracked it down to the follow sequence:
- A test is run that uses fixtures (via
fixtures.set
) - A test that doesn't use fixtures and is testing assuming that previous fixture is not set
The second test was failing because the fixture from the first test was still there. Would it make sense to auto-cleanup the fixtures in a beforeEach
? I can of course manually do this in my test case but it seems it would be nice if karma-fixture had that cleanup built-in.
If there is interest I can investigate how to do this. But before I spent any time on it I wanted to see IF adding that auto-cleanup is desirable.