wnr / element-resize-detector

Optimized cross-browser resize listener for elements.
MIT License
1.32k stars 118 forks source link

State purity in tests #24

Closed m59peacemaker closed 8 years ago

m59peacemaker commented 9 years ago

I suggest creating and appending a new element for each test.. is there some magic going on that takes care of that, or are all the tests using the same DOM/state ? I have limited experience with Jasmine/Karma (I use tape), so I might be missing something. If each test is reusing the same element, I'd be glad to submit a PR to improve this. I think the Jasmine way is to use beforeEach(), though I personally prefer to skip the magic and manually call functions I need per test. Tell me what you think and I'll see if I can help.

wnr commented 9 years ago

I agree with every single statement.

A PR would be awesome :)

wnr commented 8 years ago

Do you still want to submit a PR for this @m59peacemaker? Otherwise I'm looking to close this issue :)

m59peacemaker commented 8 years ago

I don't have the time :/ It's not needed anyway.

wnr commented 8 years ago

Okay, thanks anyway :)