Skip to content

Commit

Permalink
CLJS compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeoffrey committed Apr 14, 2022
1 parent d0a9158 commit 2e41d98
Show file tree
Hide file tree
Showing 18 changed files with 685 additions and 1,109 deletions.
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.16.8"}}}
:test {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"
"-Dhyperfiddle.rcf.generate-tests=true"]
:extra-paths ["test" #_"example"]
:extra-paths ["test" "example"]
:extra-deps {thheller/shadow-cljs {:mvn/version "2.16.8"}
missionary/missionary {:mvn/version "b.26"}
org.clojure/core.async {:mvn/version "1.5.648"}
Expand Down
7 changes: 4 additions & 3 deletions example/example.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
(inc 1) := 2

"wildcards"
{:a :b, :b [2 :b]} := '{:a _, _ [2 _]}
{:a :b, :b [2 :b]} := {:a _, _ [2 _]}

"unification"
{:a :b, :b [2 :b]} := '{:a ?b, ?b [2 ?b]}
{:a :b, :b [2 :b]} := {:a ?b, ?b [2 ?b]}

"unification on reference types"
(def x (atom nil))
{:a x, :b x} := '{:a ?x, :b ?x}
{:a x, :b x} := {:a ?x, :b ?x}

"REPL bindings work"
(inc 1)
Expand Down Expand Up @@ -69,6 +69,7 @@
)))



(tests
"core.async"
(def c (chan))
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "rcf",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"shadow-cljs": "^2.14.2",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cljs-test": "^0.1.0"
"karma": "6.3.17",
"karma-chrome-launcher": "3.1.1",
"karma-cljs-test": "0.1.0",
"shadow-cljs": "2.16.8"
},
"repository": {
"type": "git",
Expand Down
18 changes: 9 additions & 9 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

echo "Clojure"
clojure -X:test :dirs "[\"test\" #_\"example\"]" :patterns "[\"example.*\" \"hyperfiddle.*\"]"

# echo "Node"
# ./node_modules/.bin/shadow-cljs -A:cljs:test release :test
# node out/node-tests.js
#
# echo "Browser"
# ./node_modules/.bin/shadow-cljs -A:cljs:test release :browser-test
# ./node_modules/.bin/karma start --single-run
clojure -X:test :dirs "[\"test\" \"example\"]" :patterns "[\"example.*\" \"hyperfiddle.rcf.*-test\"]"

echo "Node"
./node_modules/.bin/shadow-cljs -A:cljs:test release :test
node out/node-tests.js

echo "Browser"
./node_modules/.bin/shadow-cljs -A:cljs:test release :browser-test
./node_modules/.bin/karma start --single-run


3 changes: 2 additions & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
:output-dir "out/js"}
:test {:target :node-test
:output-to "out/node-tests.js"
:ns-regexp "^(hyperfiddle.rcf.tests|example.*)"}
:ns-regexp "^(hyperfiddle.rcf.*-test|example)"
}
:browser-test {:target :karma
:output-to "out/karma-tests.js"
:ns-regexp "^(hyperfiddle.rcf.tests|example.*)"}}}
Loading

0 comments on commit 2e41d98

Please sign in to comment.