voorhoede / riotjs-style-guide

Opinionated RiotJS Style Guide for teams.
Creative Commons Zero v1.0 Universal
287 stars 22 forks source link

Feature request: add a section about tests #53

Open davidbgk opened 8 years ago

davidbgk commented 8 years ago

Maybe add a section related to testing?

http://riotjs.com/forum/#!/using:testing-my-tags/if-you-use-a-test-suite-lik might be a starting point.

jbmoelker commented 8 years ago

@davidbgk agree that would be a good addition. We haven't figured out the best test setup yet to put in the guide. We have a suggestion for "unit testing" pre-rendered tags and end-to-end testing of tags in isolation. However this also depends on a developer's preference for specific testing frameworks.

The Riot team is refactoring their unit test setup, so am also waiting to see what they come up with.

If the section would be "Test your tags", what do you feel should be in the how-to?

davidbgk commented 8 years ago

@jbmoelker nice, thanks for the inspiring links! I think that @gianlucaguarini refers to that commit about the test refactoring which gives some insights on how it can be unit tested.

Maybe we should follow that path and "just" propose something in the vein of what you did for now. Having an example of the tag mount/unmount dance during a test would be great too :)

I'm pretty new to both JS and Riot so I'm not familiar with unit testing libs in these communities.

jbmoelker commented 8 years ago

status update: @gianlucaguarini has improved the test setup for Riot itself. Which is definitely worth a look. For example the core spec. Also notice the helpers, which you could reuse. Haven't tried it out myself yet, so am not yet comfortable writing anything about it in this guide.

davidbgk commented 8 years ago

Great, thanks for the update @jbmoelker 👍 I understand that it need to be tested (!) prior any addition to the guide :)