bensu / doo

doo is a library and lein plugin to run cljs.test on different js environments.
Eclipse Public License 1.0
324 stars 63 forks source link

Error attempting to use lein-doo 0.1.7 #120

Open ricardojmendez opened 7 years ago

ricardojmendez commented 7 years ago

Get the following assertion error when attempting to run lein with-profile test doo phantom with plugin 0.1.7:

(not (and (default? cli-alias) (not (contains? alias-map :default))))

Version 0.1.6 of the plugin works just fine. Configuration is simply :doo {:build "test"}

MatthewDarling commented 6 years ago

Skimming the responsible code a bit, it seems like that assertion is meant to catch not specifying an environment (lein doo, without setting a default) or an invalid environment (lein doo foo).

phantom should be a valid environment alias, though.

Do you have an example repository that shows this behaviour?

miikka commented 6 years ago

This is still an issue with Doo 0.1.8. There's an assertion that has helpful text, but it unhelpfully also prints a stacktrace. The stacktrace should be suspended, and in general, assertions shouldn't be used for validating the command-line arguments. Assertion failures should indicate a bug in the program and the user not knowing the right arguments is not a bug.

https://github.com/bensu/doo/blob/fe0e7d480a50195815f8f07216ecd8e4233bbf8f/plugin/src/leiningen/doo.clj#L101-L111

bensu commented 6 years ago

That sounds like a sensible rule. figwheel has some good error reporting, maybe we should steal it.