Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically generate :test-commands from lein-cljsbuild :build specs #20

Closed
cemerick opened this issue Oct 12, 2013 · 2 comments
Closed

Comments

@cemerick
Copy link
Owner

Right now, the project.clj of this project (and any others that use lein-cljsbuild and clojurescript.test) contains this:

  :cljsbuild {:builds [{:source-paths ["src" "test"]
                        :compiler {:output-to "target/cljs/whitespace.js"
                                   :optimizations :whitespace
                                   :pretty-print true}}
                       {:source-paths ["src" "test"]
                        :compiler {:output-to "target/cljs/simple.js"
                                   :optimizations :simple
                                   :pretty-print true}}
                       {:source-paths ["src" "test"]
                        :compiler {:output-to "target/cljs/advanced.js"
                                   :optimizations :advanced
                                   :pretty-print true}}]
              :test-commands {"phantom-whitespace" ["phantomjs" :runner "target/cljs/whitespace.js"]
                              "phantom-simple" ["phantomjs" :runner "target/cljs/simple.js"]
                              "phantom-advanced" ["phantomjs" :runner "target/cljs/advanced.js"]}}

…but the clojurescript.test plugin could easily produce the above (or something functionally equivalent) from:

  :cljsbuild {:builds [{:source-paths ["src" "test"]
                        :test-with "phantomjs"
                        :compiler {:output-to "target/cljs/whitespace.js"
                                   :optimizations :whitespace
                                   :pretty-print true}}
                       {:source-paths ["src" "test"]
                        :test-with "phantomjs"
                        :compiler {:output-to "target/cljs/simple.js"
                                   :optimizations :simple
                                   :pretty-print true}}
                       {:source-paths ["src" "test"]
                        :test-with "phantomjs"
                        :compiler {:output-to "target/cljs/advanced.js"
                                   :optimizations :advanced
                                   :pretty-print true}}]}

The :test-with value could also optionally be a vector into which the :output-to path is conjed.

This isn't a huge improvement in actual complexity, but would be nice "ergonomically".

@magomimmo
Copy link
Contributor

+1

@cemerick
Copy link
Owner Author

Sorry for the troubles, but I've deprecated this project. Please see the notice at the top of the repo's README. This is a good thing, fundamentally. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants