I want to run a simple ClojureScript test, but am getting an error:
$ npx shadow-cljs compile test
shadow-cljs - config: /Users/blah/cljslab/shadow-cljs.edn
[:test] Compiling ...
The required namespace "cljslab.core.actions.building-blocks" is not available, it was required by "cljslab/core/actions/building_blocks_test.cljs".
files:
package.json
:
{
"name": "cljslab",
"version": "0.0.1",
"private": true,
"devDependencies": {
"shadow-cljs": "2.22.9"
}
}
shadow-cljs.edn
:
;; shadow-cljs configuration
{:source-paths
["src/test"
"src/cljslab"]
:dependencies
[]
:builds
{:cli
{:target :node-script
:main cljslab.delivery.cli.cljslab/init
:output-to "out/cljslab/cljslab.js"}
:test
{:target :node-test
:output-to "out/test/cljslab/cljslab-test.js"
:autorun true}}}
src/cljslab/core/actions/building_blocks.cljs
:
(ns cljslab.core.actions.building-blocks)
(defn action [x] x)
src/test/cljslab/core/actions/building_blocks_test.cljs
:
(ns cljslab.core.actions.building-blocks-test
(:require [cljs.test :refer (deftest is testing)]
[cljslab.core.actions.building-blocks :refer (action)]))
((deftest name-test
(testing "Context of the test assertions"
(is (= 2 (action 1))))))
What is missing?