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:
Error message pull request Testing Macro (computer science) Form (document) optimization Requests
Published at DZone with permission of Jakub Holý, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Strategies for Reducing Total Cost of Ownership (TCO) For Integration Solutions
Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
Front-End: Cache Strategies You Should Know