Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Adding simple watchable functional test capabilities #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

larsgk
Copy link

@larsgk larsgk commented Jan 28, 2017

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

@googlebot
Copy link

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

@larsgk
Copy link
Author

larsgk commented Jan 28, 2017 via email

@googlebot
Copy link

CLAs look good, thanks!

@robdodson
Copy link
Contributor

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?

@larsgk
Copy link
Author

larsgk commented Feb 7, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants