Skip to content

Commit

Permalink
try playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
henryw374 committed Jan 15, 2024
1 parent dc22ce9 commit ba5dce0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
with:
cli: 1.11.1.1155 # Clojure CLI based on tools.deps

#- name: Run Clj Unit tests
# run: make test-clj

- name: Install Chrome
uses: browser-actions/setup-chrome@latest

- name: Generate library code
run: make generate-all

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generate-all:
clojure -Adev -X com.widdindustries.gen.gen.tempo/generate-all
test-cljs:
clojure -Adev -X com.widdindustries.tiado-cljs2/tests-ci-shadow :compile-mode :release
clojure -Adev -X dev/tests-ci-shadow :compile-mode :release
test-clj:
clojure -Adev -X dev/run-clj-tests
.PHONY: list
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,6 @@ api todo - see todos in tempo.cljc

### to/from legacy date

### clocks

todo: fixed, offset

### instant-from

- epoch millis + (optionally) nanos
Expand Down
3 changes: 2 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
backtick/backtick {:mvn/version "0.3.4"}
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
medley/medley {:mvn/version "1.4.0"}
com.widdindustries/tiado-cljs2 {:git/url "https://github.com/henryw374/tiado-cljs2.git" :git/sha "8aa3042d834d2695ec9d4f9f65532573c849d6bf"}
com.widdindustries/tiado-cljs2 {:git/url "https://github.com/henryw374/tiado-cljs2.git" :git/sha "40d94de3ae6c1692d99d66a2a3d48c93dbc2f34a"}
com.widdindustries/cljc.java-time {:mvn/version "0.1.21"}
;com.widdindustries/time-literals {:mvn/version "0.1.10" :exclusions [com.widdindustries/cljs.java-time]}
org.clojure/tools.namespace {:mvn/version "1.4.4"}
babashka/fs {:mvn/version "0.5.20"}
}
}}
:release {:extra-deps {applied-science/deps-library {:mvn/version "RELEASE"}}
Expand Down
19 changes: 16 additions & 3 deletions dev/dev.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require [clojure.java.io :as io]
[com.widdindustries.tiado-cljs2 :as util]
[kaocha.repl :as kaocha]
[babashka.fs :as fs]
[clojure.tools.namespace.repl :as refresh]
[com.widdindustries.gen.gen.tempo :as gen]))

Expand All @@ -15,8 +16,10 @@
(refresh/refresh-all :after 'dev/x))

(defn browser-test-build [compile-mode opts]
((get util/compile-fns compile-mode)
(util/browser-test-config) opts)
(.mkdirs (io/file "web-target" "public" "browser-test"))
(spit "web-target/public/browser-test/index.html"
(spit "web-target/public/browser-test/foo.html"
"<!DOCTYPE html>
<html><head>
<title>kaocha.cljs2.shadow-runner</title>
Expand All @@ -30,14 +33,24 @@
</script>
<script>kaocha.cljs2.shadow_runner.init();</script></body></html>"
)
((get util/compile-fns compile-mode)
(util/browser-test-config) opts)

(println "for tests, open " util/test-url))


(defn test-watch []
(browser-test-build :watch {}))

(defn tests-ci-shadow [{:keys [compile-mode]}]
(util/start-server)
(browser-test-build compile-mode {})
(println (fs/list-dir "web-target/public"))
(println (slurp (str util/shadow-local "/browser-test/foo.html")))
(try
(util/kaocha-exit-if-fail (util/run-tests-headless nil))
(catch Exception e
(println e)
(System/exit 1))))

(comment

; start up live-compilation of tests
Expand Down

0 comments on commit ba5dce0

Please sign in to comment.