Fixing clojurescript.test Failing with "ReferenceError: Can't find variable: cemerick"
Join the DZone community and get the full member experience.Join For Free
cemerick.cljs.test) may fail with this confusing exception:
ReferenceError: Can't find variable: cemerick
due to couple of reasons:
- Your test namespaces do not require
cemerick.cljs.test(and thus it is missing from the compiled .js; requiring macros is not enough)
- cljsbuild has not included any of your test files (due to wrong setup etc.; this is essentially another form of #1)
- You are trying to test with the node runner but have built with
:whitespace(for node you need to concatenate everything into a single file, which only happens if you use
There is a pull request to provide a better error message but until then you have to be aware of these problems.
Example failures from all the runners:
Published at DZone with permission of Jakub Holý, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.