karma-fixture
karma-fixture copied to clipboard
Create new fixture container on cleanup
I noticed that the cleanup()
method simply empties the fixture.el
element. Wouldn't it make more sense to create a completely new container instead? In my case, the fixture container ends up with some state data that I don't want to remain for the rest of the tests.
I changed this line to this:
return this.el = document.createElement('div')
And it seems to work great. I don't see a reason to share the fixture container between tests.