Open slimsag opened 8 years ago
I would definitely like to see the testing approach that you guys will take, currently once can only test non DOM based code. Would be nice to get such level of tests for the visual end and dom based functions as well.
I'd like to have something like React's shallow rendering, see https://facebook.github.io/react/docs/test-utils.html#shallow-rendering. Such testing is easy to reason about, tests only one component at a time, requires no DOM and thus might even run with gc
.
That sounds great @neelance ! I like the idea of that a lot :) I will see if I can find time to look into it.
I also think that component based testing is the way to initially go. They are unit tests of that unit / component.
@slimsag I'm struggling a little bit trying to determine the best way to test more complex element hierarchies. I feel like maybe we need a higher-order wrapper for the mockObject
, but I'm not entirely sure of the best way to track element identity, to test for correct order, etc - ideally I'd like to sort this out in a way that allows table-driven testing for maintenance.
I'm pretty much blocked on doing any further work until we either decide what to do about #115, or work out how to go about testing trees of elements.
Sorry I haven't had a chance to look at this yet @pdf -- I think we just need to add some more extensive helper utility functions to our test suite but I haven't had time to figure out which are needed / write them. I'll gladly accept idea's/PRs in this area if anyone wants to beat me to it.
I've responded on #115 and think we can find a solution there very soon (perhaps today)
as it requires a browser DOM to be present, etc.