(find-test-namespaces source-dirs)Takes a list of directories and searches them for test source files and returns a list of namespaces that may have tests in them.
Takes a list of directories and searches them for test source files and returns a list of namespaces that may have tests in them.
(no-namespaces-content {:keys [test-ns app-id]
:or {test-ns (genned-test-ns "unknown")
app-id "app-auto-testing"}})(run-tests)(run-tests env-or-ns)(run-tests env-or-ns & namespaces)Differs from cljs.test/run-tests in that this macro by finds all
the available namespaces in the local sources to test and tests
them.
run-tests runs all cljs.tests in the given namespaces; prints
results. Defaults to running all the namespaces in the local source
files if no namespaces are given.
Will throw an exception if tests have failed. This is only useful if
you are NOT running asynchronous tests. An exception thrown from a
-main will cause a process started with the --main CLI arg to
exit unsuccessfully.
Usage examples:
;; run all tests in local sources
(run-tests)
;; run tests in 'example.core-tests
(run-tests 'example.core-tests) ;;
;; run tests in 'example.core-tests and display with cljs-test-display
(run-tests (cljs-test-display.core/init!) 'example.core-tests)
Differs from `cljs.test/run-tests` in that this macro by finds all
the available namespaces in the local sources to test and tests
them.
`run-tests` runs all cljs.tests in the given namespaces; prints
results. Defaults to running all the namespaces in the local source
files if no namespaces are given.
Will throw an exception if tests have failed. This is only useful if
you are NOT running asynchronous tests. An exception thrown from a
`-main` will cause a process started with the `--main` CLI arg to
exit unsuccessfully.
Usage examples:
;; run all tests in local sources
(run-tests)
;; run tests in 'example.core-tests
(run-tests 'example.core-tests) ;;
;; run tests in 'example.core-tests and display with cljs-test-display
(run-tests (cljs-test-display.core/init!) 'example.core-tests)(run-tests-async timeout)(run-tests-async timeout env-or-ns)(run-tests-async timeout env-or-ns & namespaces)This is only supported when run in conjunction with the
figwheel.main's --main CLI option.
Differs from cljs.test/run-tests in that this macro by finds all
the available namespaces in the local sources to test and tests
them.
This is helpful when running asynchronous tests from a main script
on the command line. run-tests-async will wait for the test run to
come to an end or time out.
The first argument run-tests-async must be a timeout integer
that is the number of milliseconds the process should wait for
completion before timing out.
The rest of the arguments are the same as figwheel.main.testing/run-tests.
The return value from run-tests-async has to be returned from the
-main function in order to block and wait for the tests to
complete. If it can not be the last statement in your -main
function then you need to make sure that the -main function returns a
[:figwheel.main.async-result/wait timeout] value.
Usage examples:
;; run all tests in local sources, time out if it takes more than 5 seconds
(run-tests-async 5000)
;; run tests in 'example.core-tests with 5000 millis timeout
(run-tests-async 5000 'example.core-tests) ;;
;; run tests in 'example.core-tests and display with cljs-test-display
(run-tests-async 5000 (cljs-test-display.core/init!) 'example.core-tests)
This is only supported when run in conjunction with the
`figwheel.main`'s `--main` CLI option.
Differs from `cljs.test/run-tests` in that this macro by finds all
the available namespaces in the local sources to test and tests
them.
This is helpful when running asynchronous tests from a main script
on the command line. `run-tests-async` will wait for the test run to
come to an end or time out.
The first argument `run-tests-async` must be a `timeout` integer
that is the number of milliseconds the process should wait for
completion before timing out.
The rest of the arguments are the same as figwheel.main.testing/run-tests.
The return value from `run-tests-async` has to be returned from the
`-main` function in order to block and wait for the tests to
complete. If it can not be the last statement in your `-main`
function then you need to make sure that the `-main` function returns a
`[:figwheel.main.async-result/wait timeout]` value.
Usage examples:
;; run all tests in local sources, time out if it takes more than 5 seconds
(run-tests-async 5000)
;; run tests in 'example.core-tests with 5000 millis timeout
(run-tests-async 5000 'example.core-tests) ;;
;; run tests in 'example.core-tests and display with cljs-test-display
(run-tests-async 5000 (cljs-test-display.core/init!) 'example.core-tests)(testing-file-content
{:keys [test-ns libs run-tests-args]
:or {test-ns (genned-test-ns "unknown") libs [] run-tests-args []}})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |