cljs.test/test-ns-block

macrosince v0.0-2814Edit
(test-ns-block env [quote ns :as form])

Source docstring:
Like test-ns, but returns a block for further composition and
later execution.  Does not clear the current env.
Source code @ clojurescript:src/main/cljs/cljs/test.cljc
(defmacro test-ns-block
  ([env [quote ns :as form]]
   (assert (and (= quote 'quote) (symbol? ns)) "Argument to test-ns must be a quoted symbol")
   (assert (ana-api/find-ns ns) (str "Namespace " ns " does not exist"))
   `[(fn []
       (set-env! ~env)
       (do-report {:type :begin-test-ns, :ns ~form})
       ;; If the namespace has a test-ns-hook function, call that:
       ~(if-let [v (ana-api/ns-resolve ns 'test-ns-hook)]
          `(~(symbol (name ns) "test-ns-hook"))
          ;; Otherwise, just test every var in the namespace.
          `(block (test-all-vars-block ~form))))
     (fn []
       (do-report {:type :end-test-ns, :ns ~form}))]))