Closed deadlyfingers closed 8 years ago
Writing tests using web-component-tester: Tried various tools to rig up some Polymer unit tests for checking results of async methods using jQuery $.ajax or Polymer iron-ajax response events.
PubSub.subscribe
and PubSub.publish
works directly with async jQuery calls.
But a nicer way is to return the jQuery ajax result as a Deferred object - ideal for unit testing using done/fail promise chains.Tests can be run on: http://localhost:5000/test/
At the minute Polymer tests are run from localhost - http://localhost:5000/test/
But another thing to look at is configuring wct
command (which launches the Selenium driver) - but it uses it's own server running on port 2000 so I would need to tie it into our jxcore localhost server running express server on port 5000. (NB: Safari also requires the Selenium SafariDriver extension to run tests - https://code.google.com/p/selenium/issues/detail?id=7933#c23)
Related posts:
http://stackoverflow.com/questions/33506850/how-can-i-replace-the-server-in-web-component-tester
Make a start on Unit Testing with Polymer web app.