Running the Tests

Testing the Compiler Infrastructure

lein test

Will run the tests for the analyzer, compiler, and closure components.

Testing JavaScript Engines

How to setup the important JavaScript runtimes.

Google V8

Checkout the V8 project. Following the build instructions here

Set the V8_HOME environment variable to the path where d8 lives.

export V8_HOME="$HOME/v8/out/native"


Get the js-shell from here Set your SPIDERMONKEY_HOME environment variable.


On macOS download a WebKit nightly and put it in your Applications folder. Update your shell profile to include the following:


NOTE: Sub in the correct macOS version if you’re not running 10.12


Setup the $NASHORN_HOME environment variable so that


prompts a JavaScript Console. Nashorn is usually under $JAVA_HOME/bin, so you can write:



Get ChakraCore from here Set your CHAKRACORE_HOME environment variable so that $CHAKRACORE_HOME/ch executes ChakraCore.

Setting up dependencies


Running the tests


Running bootstrapped ClojureScript tests

If you have Node.js installed, you can run the bootstrapped ClojureScript test suite (located at src/test/self/self_host/test.cljs):


You can also build and run the ClojureScript compiler test suite in bootstrapped mode within Node.js by running


Running ClojureScript CLI (cljs.main) tests

You can run tests exercising the ClojureScript CLI by running

./script/test-cli repl-env [repl-env-opts-edn]

where repl-env is any of the built-in REPL environments (node, browser, etc.). This will be passed to cljs.main 's -re option. You can also specify a non-built-in REPL environment, but you would have to revise script/test-cli to include the downstream REPL environment on the classpath. You can also pass optional repl-env-opts-edn, which will be passed to cljs.main 's -ro option.

Don’t forget

Besides the tests it’s important to make sure that the Browser REPL hasn’t accidentally been broken. Double-check using the sample found in the repository.