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

No output for successful test runs #533

Open
techmindful opened this issue Jul 11, 2021 · 4 comments
Open

No output for successful test runs #533

techmindful opened this issue Jul 11, 2021 · 4 comments

Comments

@techmindful
Copy link

elm-test seems to only output test cases that failed, and omits the ones that succeeded. Sometimes the information on successful test cases is useful. For example, I'm implementing interactive coding on my webpage, and using elm-test on the backend to run the code. I would like to tell the user which test cases their code got right, on top of which ones they got wrong.

@gampleman
Copy link
Contributor

Perhaps for your use case using one of the machine readable output formats might be the best? They do indeed output all the tests run.

@techmindful
Copy link
Author

@gampleman I should've elaborated a lot more and mentioned that I've tried the --report json option. It does output passed test cases. However, there is no expected and actual values included. This seems to be because information of expected and actual values are included in "failures". But a passed test case doesn't have failure. The code around here may be relevant.

For my case it would have been very convenient if the frontend simply hears about elm-test output from server, and display each test case's expected and actual values.

@mpizenberg
Copy link
Contributor

@techmindful I'm answering a little bit late but I think you might be interested in the setup that was done for the exercism platform: https://github.com/exercism/elm-test-runner

This repo holds a docker containing a program composed of two pieces, (1) a setup for the elm-test-rs test runner to output a report in the exercism json format, and (2) a code snippet extractor, aimed at extracting the expectations from the test code. Both outputs are merged together to generate the final json in the exercism format with both the tests results and associated code snippets for test expectations.

Of course the repo has limitations and some of the building blocks for the test extractor take advantages of the constraints imposed by the exercism setup, but nonetheless, I thought this might interest you.

@lydell
Copy link
Collaborator

lydell commented May 29, 2022

FYI I believe elm-test-rs 2.0.1 prints even successful tests when you pass the verbose -v flag.

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

4 participants