Closed zenorocha closed 9 years ago
I would be happy to work on this. I just need someone to review my work.
On the Polymer side we're hoping to get out an article about how we recommend unit testing at some point in the next few months, but I'd be really keen to see how this is applied to raw custom elements.
Fwiw, happy to review. We currently use Mocha and Chai for the testing side of things and it works quite well.
I still need to figure out how to do that. Probably using something like di.js to simplify mocking the DOM.
Do you guys have any suggestions?
Here are some nice studies from @eee-c:
I've resumed my work on a Unit Testing primer for Polymer elements. We've been holding off due to some changes we wanted to land in seed-element
, but with these now complete we should be able to get out more guidance on this topic soon.
@zenorocha There are some specific patterns we prefer to use for testing that aren't quite captured in the articles Chris has written, but we'll do our best to get this guide up in the next few weeks.
That's great to hear, thanks @addyosmani :)
With the standardization of webcomponents-tester
I think we do this now. @addyosmani - I would love to collaborate on an article for my own selfish desire to be better at testing components. If not, one of us could do it on our own. Let me know :)
I wrote https://www.polymer-project.org/0.5/articles/unit-testing-elements.html after my original comment which tried to walk through web-component-tester. We could definitely use a 1.0 update to this for the Polymer site, but it might make more sense there vs wc.org. That said, I'd also be interested in seeing a separate Custom Elements + WCT tutorial at some point :)
Closing this one for now since there was no action since last year, if there's anyone up to do that please send a PR.
This is another topic that is pretty important to cover.
I noticed that most Polymer/X-Tag elements contains unit tests. So maybe we can get someone from these teams to write about it. What do you think @addyosmani @robdodson @potch @sole @csuwildcat?