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

Document karma's :runner-ns option #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions docs/target-karma.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The build options are:
`:target`:: `:karma`
`:output-to`:: A path/filename for the js file.
`:ns-regexp`:: (optional) A regex to match the test namespaces, defaults to "-test$
`:runner-ns`:: (optional) A namespace that can contain a start, stop, and init function. Defaults to
`shadow.test.karma`.

So you might have something like this:

Expand Down Expand Up @@ -82,3 +84,16 @@ LOG: 'Testing boo.sample-spec'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6): Executed 1 of 1 SUCCESS (0.007 secs / 0.002 secs)
```

In case you need to perform extra initialization steps before the tests are run you can do so by supplying a custom `:runner-ns`, which might look like this:

```cljs
(ns myapp.karma
(:require [shadow.test.karma]))

(defn ^:export init []
(my-extra-init-step)
(shadow.test.karma/init))
```

Then in the build config add `:runner-ns myapp.karma`.