 
 (ns clojure.test.check.clojure-test-test
   (:require #?@(:cljs
-                [[cljs.test :as test :refer [test-var] :refer-macros [is]]
+                [[cljs.test
+                  :as test
+                  :include-macros true
+                  :refer [test-var]
+                  :refer-macros [is]]
                  [cljs.reader :refer [read-string]]])
             #?(:clj
                [clojure.test :as test :refer :all])

          "calling with other :type keeps last-trial-report constant")
      (is (re-seq
           #"(Passing trial \d{3} / 1000 for .+\n)+"
           (capture-test-var #'long-running-spec)))
      (is (> @last-trial-report trial-report-1)
          "running the test makes last-trial-report to increment")))

  (let [[report-counters stdout]
        #?(:clj
           (binding [ct/*report-shrinking* true
                     ;; need to keep the failure of this-is-supposed-to-fail from
                     ;; affecting the clojure.test.check test run
                     *report-counters* (ref *initial-report-counters*)]
             (let [out (capture-test-var #'this-is-supposed-to-fail)]
               [@*report-counters* out]))

           :cljs
           (binding [ct/*report-shrinking* true]
             ;; need to keep the failure of this-is-supposed-to-fail from
             ;; affecting the clojure.test.check test run
             (let [restore-env    (test/get-current-env)
                   _              (test/set-env! (test/empty-env))
                   report-str     (capture-test-var #'this-is-supposed-to-fail)
                   env            (test/get-current-env)]
               (test/set-env! restore-env)
               [(:report-counters env) report-str])))]
    (is (== 1 (:fail report-counters)))
    (is (re-seq
         #?(:clj

(defn test-ns-hook
  []
  (is (-> (capture-test-var #'default-trial-counts)
          second
          read-string
          :num-tests
          (= ct/*default-test-count*)))

  (is (-> (capture-test-var #'trial-counts)
          second
          read-string
          (select-keys [:test-var :result :num-tests])
          (= {:test-var "trial-counts", :result true, :num-tests 5000})))

  (binding [ct/*report-trials* true]
    (let [output (second (capture-test-var #'trial-counts))]
      (is (re-matches #?(:clj  (java.util.regex.Pattern/compile "(?s)\\.{5}.+")
                         :cljs #"\.{5}[\s\S]+")
                      output))))
