« Home

Using headless Chrome for Ember testing

As of Chrome v59, you can run it in a headless environment, which means you don’t need PhantomJS for running tests anymore. Using it is the easiest thing in the world:

// testem.js

/*jshint node:true*/
module.exports = {
  "framework": "qunit",
  "test_page": "tests/index.html?hidepassed",
  "disable_watching": true,
  "launch_in_ci": [
    "Chrome"
  ],
  "browser_args": {
    'Chrome': [ '--headless', '--disable-gpu', '--remote-debugging-port=9222' ],
  },
  "launch_in_dev": [
    "Chrome"
  ]
};

If you have a testem.json file, delete it.

Then:

ember test --server

That’s it!