Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Chrome headless #136

Merged
merged 2 commits into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ in `project.clj`:
* `js-env` can be any `chrome`, `firefox`, `ie`, `safari`, `opera`,
`slimer`, `phantom`, `node`, `rhino`, or `nashorn`. In the future it
is planned to support `v8`, `jscore`, and others.
* Note that `chrome-headless` requires `karma-chrome-launcher` >= 2.0.0 and Chrome >= 59
* `watch-mode` (optional): either `auto` (default) or `once` which
exits with 0 if the tests were successful and 1 if they failed.
* `build-id` is one of your `cljsbuild` profiles. For example `test` from:
Expand Down
38 changes: 20 additions & 18 deletions library/src/doo/karma.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@
(str "karma-" name "-launcher"))

(def karma-envs
{:chrome {:plugin (karma-plugin-name "chrome")
:name "Chrome"}
:chrome-canary {:plugin (karma-plugin-name "chrome")
:name "ChromeCanary"}
:firefox {:plugin (karma-plugin-name "firefox")
:name "Firefox"}
:safari {:plugin (karma-plugin-name "safari")
:name "Safari"}
:opera {:plugin (karma-plugin-name "opera")
:name "Opera"}
:ie {:plugin (karma-plugin-name "ie")
:name "IE"}
:karma-phantom {:plugin (karma-plugin-name "phantomjs")
:name "PhantomJS"}
:karma-slimer {:plugin (karma-plugin-name "slimerjs")
:name "SlimerJS"}
:electron {:plugin (karma-plugin-name "electron")
:name "Electron"}})
{:chrome {:plugin (karma-plugin-name "chrome")
:name "Chrome"}
:chrome-canary {:plugin (karma-plugin-name "chrome")
:name "ChromeCanary"}
:chrome-headless {:plugin (karma-plugin-name "chrome")
:name "ChromeHeadless"}
:firefox {:plugin (karma-plugin-name "firefox")
:name "Firefox"}
:safari {:plugin (karma-plugin-name "safari")
:name "Safari"}
:opera {:plugin (karma-plugin-name "opera")
:name "Opera"}
:ie {:plugin (karma-plugin-name "ie")
:name "IE"}
:karma-phantom {:plugin (karma-plugin-name "phantomjs")
:name "PhantomJS"}
:karma-slimer {:plugin (karma-plugin-name "slimerjs")
:name "SlimerJS"}
:electron {:plugin (karma-plugin-name "electron")
:name "Electron"}})

(def envs (set (keys karma-envs)))

Expand Down
2 changes: 1 addition & 1 deletion library/test/clj/test/doo/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(are [js-env] (doo/valid-js-env? js-env)
:rhino :nashorn :slimer :phantom :node
:chrome :safari :firefox :opera :ie :electron
:karma-phantom :karma-slimer))
:karma-phantom :karma-slimer :chrome-headless))
(testing "We can resolve aliases"
(are [alias js-envs] (= (doo/resolve-alias alias {}) js-envs)
:phantom [:phantom]
Expand Down