Skip to content

Commit

Permalink
cljsc warnings, update deps & test runners (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkpkpk authored Feb 15, 2023
1 parent 5c1ac41 commit 24e5b11
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
17 changes: 13 additions & 4 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}
org.clojure/clojurescript {:mvn/version "1.11.4"}
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/clojurescript {:mvn/version "1.11.60"}
org.clojure/core.async {:mvn/version "1.5.648"}}
:aliases {:cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.17.2"}
binaryage/devtools {:mvn/version "1.0.4"}}
:extra-paths ["test"]}
:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.63.998"}
io.github.cognitect-labs/test-runner {:git/tag "v0.5.0"
:git/sha "48c3c67"}}
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
:git/sha "dfb30dd"}}
:extra-paths ["test"]}
:jvm-test {:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
:git/sha "dfb30dd"}}
:extra-paths ["test"]
:main-opts ["-m" "cognitect.test-runner"]
:exec-args {:nses [superv.async-test]
:dirs ["test"]}
:exec-fn cognitect.test-runner.api/test}
:cljs-test {:extra-paths ["test"]
:main-opts ["-m" "cljs.main" "-t" "node" "-m" "superv.node-runner"]}
:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.6.7"
:git/sha "22c2d09"}
borkdude/gh-release-artifact {:git/url "https://github.com/borkdude/gh-release-artifact"
Expand Down
8 changes: 4 additions & 4 deletions src/superv/async.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
{:body exps
:finally-clauses finally})))
finally (rest (first finally))
e (if (:ns &env) `js/Error Exception)]
e (if (:ns &env) `js/Error `Exception)]
`(go
(try
~@body
Expand Down Expand Up @@ -203,7 +203,7 @@
{:body exps
:finally-clauses finally})))
finally (rest (first finally))
e (if (:ns &env) `js/Error Exception)]
e (if (:ns &env) `js/Error `Exception)]
`(let [c# (check-supervisor S)
id# (-register-go ~S (quote ~exps))]
(go
Expand Down Expand Up @@ -655,7 +655,7 @@ Throws if any result is an exception or the context has been aborted."
{:body exps
:finally-clauses finally})))
finally (rest (first finally))
e (if (:ns &env) `js/Error Exception)]
e (if (:ns &env) `js/Error `Exception)]
`(let [c# (check-supervisor S)
id# (-register-go ~S (quote ~body))]
(go
Expand Down Expand Up @@ -767,7 +767,7 @@ Throws if any result is an exception or the context has been aborted."
(when-first [~bind ~gxs]
~(do-mod mod-pairs)))))))
res-ch (gensym "res_ch__")
e (if (:ns &env) `js/Error Exception)]
e (if (:ns &env) `js/Error `Exception)]
`(let [~res-ch (chan)
iter# ~(emit-bind res-ch (to-groups seq-exprs))]
(go (try (<? ~S (iter# ~(second seq-exprs)))
Expand Down
17 changes: 17 additions & 0 deletions test/superv/node_runner.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(ns superv.node-runner
(:require [cljs.nodejs]
[cljs.test]
[superv.async-test]))

(defn run-tests
([] (run-tests nil))
([opts]
(cljs.test/run-tests (merge (cljs.test/empty-env) opts)
'superv.async-test)))

(defn -main [& args]
(cljs.nodejs/enable-util-print!)
(defmethod cljs.test/report [:cljs.test/default :end-run-tests] [_] (js/process.exit 0))
(run-tests))

(set! *main-cli-fn* -main)

0 comments on commit 24e5b11

Please sign in to comment.