mpizenberg / elm-test-rs

Fast and portable executable to run your Elm tests
BSD 3-Clause "New" or "Revised" License
80 stars 13 forks source link

elm-test-rs make --report json should only print json to stderr #103

Closed lydell closed 2 years ago

lydell commented 2 years ago

elm-test-rs make --report json seems to add “Error: Compilation failed” right after the JSON, causing JSON parse errors when I try to read it via JSON.parse(stderr).

{"type":"compile-errors","errors":[...]}Error: Compilation failed
mpizenberg commented 2 years ago

(for myself) have a look at that stdout/stderr inconsistency with the normal command. I had thought the json output was in stdout as for the normal command and so it didn't matter what was printed to stderr.

lydell commented 2 years ago

elm-test make --report json seems to write the JSON to stderr. I think it’s because elm make --report json prints the JSON to stderr.

mpizenberg commented 2 years ago

@lydell I've introduced and explained some stdio behavior changes in the following PR. Please let me know if that makes sense to you. https://github.com/mpizenberg/elm-test-rs/pull/109

lydell commented 2 years ago

Cool! I will take a closer look later, but a quick thought is to mention in the readme the intentional deviation from elm-test make --report json (prints on stdout instead of stderr).

mpizenberg commented 2 years ago

This behavior difference is now documented in the readme. Thanks for the feedback. I'm closing this but we can re-open if needed at some point.