shadow-cljs

heyarne 2025-11-18T14:21:55.783409Z

It looks like shadow-cljs doesn't detect the assertions in my tests. my test looks like this:

(ns computersandblues.lodestone.match-test
  (:require  [cljs.test :refer-macros [deftest is]]
             [computersandblues.lodestone.match :as match]))

(deftest query->tokens
  (deftest split-on-whitespace
    (is (= (match/query->tokens "foo bar") ["foo" "bar"])))
  (deftest grouping-by-quoting
    (is (= (match/query->tokens "foo \"bar baz\"") ["foo" "bar"]))))
and this is my shadow-cljs.edn:
{:source-paths
 ["src"]
  ,,,
 :builds
 {,,,
  :test
  {:target :node-test
   :output-to "public/tests.js"
   :ns-regexp "-test$"
   :autorun true}}}

Harold 2025-11-18T15:56:00.348319Z

deftest inside deftest looks weird to my eyes. Maybe the inner ones are meant to be testing ? https://clojuredocs.org/clojure.test/testing

heyarne 2025-11-18T17:08:54.618669Z

indeed, that solved it

heyarne 2025-11-18T17:08:55.994159Z

thanks

Harold 2025-11-18T17:20:02.590069Z

🆒

heyarne 2025-11-18T14:22:40.653419Z

Running npx shadow-cljs watch test --config-merge '{:autorun true}' gives me

[:test] Build completed. (55 files, 2 compiled, 0 warnings, 0.77s)
[:test] Compiling ...
========= Running Tests =======================

Testing computersandblues.lodestone.match-test

Ran 1 tests containing 0 assertions.
0 failures, 0 errors.
===============================================

heyarne 2025-11-18T15:11:33.761039Z

Adding an additional, failing test changes this to "ran 2 tests" but it still doesn't detect (and run?) any assertions