Adding simple watchable functional test capabilities
Hi @robdodson ,
The Good:
This small addition allows creation of unit/functional test files (residing in 'functest', which are picked up on any element code change (html under src) or functional test script change (js under functest).
The Bad:
I have tried it locally in the generated project, where it works fine, but couldn't see how to run and test the modified generator with a local setup (only when pulled from npm... more to learn). So what you see is modified to match the working project but not actally tried out as is (so I fully accept some iterations here).
The Ugly:
Currently, each test script finds a specific Polymer 1 element file and uses the existing build functionality to rip out and eval the script part, where the Polymer function is hijacked (works for locally mocked function testing - but maybe you have a better idea?).
Anyway - please tell me where to go from here :)
NOTE: In our devgroup, we need something for Polymer 2 like this VERY soon - and given the approach would not work on classes (the same way as hijacking the Polymer function), I'd really appreciate some inspirational input ;)
br Lars
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
- If you signed the CLA as a corporation, please let us know the company's name.
I signed it!
:)
On Sat, Jan 28, 2017 at 7:25 PM, googlebot [email protected] wrote:
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 Please visit https://cla.developers.google.com/ https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data https://cla.developers.google.com/clas and verify that your email is set on your git commits https://help.github.com/articles/setting-your-email-in-git/.
- If you signed the CLA as a corporation, please let us know the company's name.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PolymerElements/generator-polymer-init-custom-build/pull/59#issuecomment-275865171, or mute the thread https://github.com/notifications/unsubscribe-auth/AA97lpa8Gd5dwaEafChRxGdA2cOW1Ev4ks5rW4gIgaJpZM4Lwk6U .
CLAs look good, thanks!
I think we generally prefer to test elements as a whole using web-component-tester. But I can see how that could get exhausting if you just want to run small functional tests. @justinfagnani @FredKSchott do you guys have any plans to incorporate more functional/unit testing tools into our toolchain?
Testing everything with the web component tester also makes sense - but during functional development (especially when the UI code may only be 20/30%) it will be very helpful with this gulp watch setup that gives you instant feedback on ctrl+s. I previously worked on an angular project where this was the normal mode of operation - and it does help a lot.