cemerick/clojurescript.test — pull request #58 by dzacarias (2014-04-25 00:28:01+00:00)
Title: Reading file contents into the environment via :test-commands 

Hi Chas,

For functions that work on textual data (coming from the wire, a user input, file upload, etc.), it is often useful to read test input data from local files, to facilitate testing. Although trivial in node, browser environments currently don't provide a standard way to do this.

To tackle this, I've made the following additions to `clojurescript.test`:
* Added support for an optional `--test-data argument` in `:test-commands`, in all runners.
* This argument takes a single file or a directory (to non-recursively refer to every file in it)
* Runners then take these files, read them, escape them and store them in an object accesible within the testing environment (`this.cljs_test_data`)
* In `cemerick.cljs.test`, a `test-data` function was added. It takes a file path and returns its string value

I think this might be a useful addition to the library and hope that this PR can be merged. I'll standby for any comments and I'll be happy to make any changes you may feel are necessary.

Thanks,
Daniel