remy / bind.js

bind.js - simple two way data binding to HTML and callbacks
694 stars 62 forks source link

Karma tests on remote shell (Cloud9) #20

Closed thurt closed 8 years ago

thurt commented 8 years ago

@remy I wonder if you have any experience running the karma tests headless (without an X server) for this package ? If it's feasible, I would like to run the browser tests on my remote shell.

remy commented 8 years ago

You can, the local karma test will fire up all browsers (on a mac)...or Chrome, I can't remember. Certainly I tested all the browsers that I said were supported.

thurt commented 8 years ago

Ok--I'll have to look into this more. I am using Cloud9 as a development environment. I was thinking Chrome might have a headless start cli option or maybe I can use phantomjs instead ?

thurt commented 8 years ago

Ok I have the karma tests working from the remote shell now. There are some helpful instructions for Cloud9 here: http://karma-runner.github.io/0.13/plus/cloud9.html

Here is how I got it to work:

  1. In karma.conf.js add keys hostname: process.env.IP and port: process.env.PORT. This allows Karma to receive incoming connections from the internet at http://<projectname>-<username>.c9users.io
  2. comment out existing keys port: 9876, browsers: [process.env.TRAVIS ? 'Firefox' : 'ChromeCanary'], and singleRun: true. Save the conf file.
  3. run npm run test on the command line.
  4. Finally open a web browser on the local machine and point to http://<projectname>-<username>.c9users.io. Karma should recognize your local browser's version and OS info before it starts executing and printing test output to the remote shell.