Skip to content

Instantly share code, notes, and snippets.

@borkdude
Last active November 10, 2018 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borkdude/145d9433d9e8cc386d40495849b0b3c8 to your computer and use it in GitHub Desktop.
Save borkdude/145d9433d9e8cc386d40495849b0b3c8 to your computer and use it in GitHub Desktop.
(ns repro.core
(:require
[repro.macros :refer [my-macro]]))
(def default-opts {})
(defn -main [& args]
(println "main:")
(println (my-macro `str default-opts)))
#?(:cljs (set! *main-cli-fn* -main))
(ns repro.macros
(:require [clojure.spec.test.alpha])
#?(:cljs (:require-macros [repro.macros :refer [my-macro]])))
#?(:clj (defmacro my-macro [sym opts]
`(let [opts# (assoc-in ~opts [:clojure.test.check :num-tests] 1)]
(clojure.spec.test.alpha/with-instrument-disabled
(clojure.spec.test.alpha/check ~sym ~opts)))))
clj -Srepro -m cljs.main -re node -m repro.core
WARNING: No such namespace: clojure.spec.test.alpha, could not locate clojure/spec/test/alpha.cljs, clojure/spec/test/alpha.cljc, or JavaScript source providing "clojure.spec.test.alpha" at line 9 core.cljc
WARNING: Use of undeclared Var clojure.spec.test.alpha/check at line 9 core.cljc
main:
(node:97191) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
Exception in thread "main" clojure.lang.ExceptionInfo: repl:25
return clojure.spec.test.alpha.check(new cljs.core.Symbol("cljs.core","str","cljs.core/str",-1971828991,null),repro.core.default_opts);
^
TypeError: Cannot read property 'test' of undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment