hexops / vecty

Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.
BSD 3-Clause "New" or "Revised" License
2.82k stars 144 forks source link

determine how best to perform testing #29

Open slimsag opened 8 years ago

slimsag commented 8 years ago

as it requires a browser DOM to be present, etc.

influx6 commented 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.

neelance commented 8 years ago

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.

slimsag commented 8 years ago

That sounds great @neelance ! I like the idea of that a lot :) I will see if I can find time to look into it.

joeblew99 commented 8 years ago

I also think that component based testing is the way to initially go. They are unit tests of that unit / component.

pdf commented 7 years ago

@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.

pdf commented 7 years ago

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.

slimsag commented 7 years ago

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)