Last active
November 16, 2017 18:35
-
-
Save nadnoslen/eba344704af8fa88a138c7a079d1d1f5 to your computer and use it in GitHub Desktop.
Ember-2.x testem.js Headless Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint node:true*/ | |
/** | |
* I'd suggest removing any old testem.json files in the root of your | |
* Ember application. | |
* | |
* With this configuration, your tests will run in Chrome by default. | |
* | |
* To run your tests in headless (FASTER) mode (launch_in_ci): | |
* `ember t` | |
* | |
* To run your tests with the browser test-page summary (launch_in_dev): | |
* `ember t -s` | |
* | |
*/ | |
const isHeadless = !process.argv.includes('-s'); | |
let options = { | |
framework: 'qunit', | |
test_page: 'tests/index.html?hidepassed&nocontainer¬ifications', | |
disable_watching: true, | |
/** | |
* `ember t` runs the `launch_in_ci` mode | |
*/ | |
launch_in_ci: [ | |
'Chrome' | |
// add more browsers here if you really want to e.g. 'Firefox' | |
], | |
/** | |
* Seems `launch_in_dev` seems to fire when you run `ember t -s` | |
*/ | |
launch_in_dev: [ | |
'Chrome' | |
// add more browsers here if you want...but why? | |
] | |
}; | |
if (isHeadless) { | |
options.browser_args = { | |
Chrome: [ | |
'--headless', | |
'--window-size=1440,900', | |
'--disable-gpu', | |
'--remote-debugging-port=9222' | |
], | |
Firefox: [ | |
'-headless', | |
'--window-size=1440,900' | |
] | |
}; | |
} | |
module.exports = options; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment