项目作者: oliyh

项目描述 :
A runner for doo which runs tests in Chrome, using the Chrome Dev Protocol with no need for karma or npm.
高级语言: Clojure
项目地址: git://github.com/oliyh/doo-chrome-devprotocol.git
创建时间: 2018-06-25T12:24:37Z
项目社区:https://github.com/oliyh/doo-chrome-devprotocol

开源协议:

下载


doo-chrome-devprotocol

A runner for doo which runs tests in Chrome, using the Chrome Dev Protocol with no need for karma or npm.

Clojars Project

Usage

  1. (require '[doo-chrome-devprotocol.core :as dc])
  2. (dc/run "path/to/doo-tests.js")
  3. ;; => {:success? true
  4. :report {:tests 2
  5. :assertions 4
  6. :failures 0
  7. :errors 0}}

run also takes an optional map of options which should be self-explanatory

  1. {:port 8899
  2. :chrome-path "/usr/bin/chromium"
  3. :chrome-args ["--headless"
  4. "--disable-gpu" ;; recommended on windows
  5. ]
  6. :chrome-launch-timeout 5000
  7. :doo-message-prefix "doo:"
  8. :document-load-timeout 60000
  9. :doo-load-timeout 10000
  10. :doo-run-timeout 60000}

Integration with clojure.test

  1. (ns my-project.runner
  2. (:require [doo-chrome-devprotocol.core :as dc]
  3. [clojure.test :refer [deftest is]]))
  4. (def doo-args
  5. {:chrome-args ["--headless" "--disable-gpu" "--no-sandbox"]})
  6. (deftest cljs-tests
  7. (let [result (dc/run "out/unit-test.js" doo-args)]
  8. (is (:success? result) (:report result))))

Development

CircleCI

License

Copyright © 2018 oliyh

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.