Skip to content

Commit

Permalink
Basic tests for shadow-cljs mode dev and release.
Browse files Browse the repository at this point in the history
  • Loading branch information
chr15m committed Mar 29, 2024
1 parent b4a680e commit 1a8d66b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/sitefoxtest/e2etests.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,58 @@
(.close browser))
(done))

(deftest basic-shadow-dev-test
(t/testing "Basic test of Sitefox on shadow-cljs."
(async done
(p/let [_ (log "Test: basic-shadow-dev-test")
server (run-server "examples/shadow-cljs"
"npm i --no-save; npm run serve"
8000)]
(p/catch
(p/let [res (js/fetch base-url)
text (.text res)]
(log "Starting test checks.")
(is (j/get-in server [:process :pid])
"Server is running?")
(is (j/get server :open)
"Server port is open?")
(is (j/get res :ok)
"Was server response ok?")
(is (includes? text "Hello")
"Server response includes 'Hello' text?")
(log "Test done. Killing server.")
(j/call server :kill)
(log "After server.")
(print)
(done))
#(catch-fail % done server))))))

(deftest basic-compiled-shadow-test
(t/testing "Basic test of Sitefox on compiled shadow-cljs."
(async done
(p/let [_ (log "Test: basic-compiled-shadow-test")
server (run-server "examples/shadow-cljs"
"npm i --no-save; npm run serve-live"
8000)]
(p/catch
(p/let [res (js/fetch base-url)
text (.text res)]
(log "Starting test checks.")
(is (j/get-in server [:process :pid])
"Server is running?")
(is (j/get server :open)
"Server port is open?")
(is (j/get res :ok)
"Was server response ok?")
(is (includes? text "Hello")
"Server response includes 'Hello' text?")
(log "Test done. Killing server.")
(j/call server :kill)
(log "After server.")
(print)
(done))
#(catch-fail % done server))))))

(deftest basic-site-test
(t/testing "Basic test of Sitefox on nbb."
(async done
Expand Down

0 comments on commit 1a8d66b

Please sign in to comment.