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

Indicate that tests are finished (to make use in a CI system easier) #240

Open
kriswest opened this issue Jul 11, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@kriswest
Copy link
Contributor

This was in another issue but hasn't been dealt with:

  1. Add a clear indication that tests are complete.
    Adding a 'done' message in the main view after all tests have run would:
  • Ensure that its easy to determine when tests are complete
  • if errors occur in before or after hooks not all tests will run, leading to the progress % stopping at less than 100%
  • Allow the test framework to be more easily installed in a CI system and the results extracted at the end of the run

progress indicator

Basically, because:

  • no message is posted at the end of the run,
  • nor is the number of tests to be run rendered anywhere
  • the progress indicator percentage is rendered in a canvas element (making it hard to read in code)

we've ended up just putting in a fixed length wait for the tests to run. That's brittle and wasting time (as it needs to wait just longer than the longest possible run).

Please can we have either the number of tests or a message posted in the window on completion.

@kriswest kriswest added the enhancement New feature or request label Jul 11, 2023
@kriswest
Copy link
Contributor Author

@robmoffat @gaganahluwalia To implement this, you can pass a callback to mocha.run(cb) in the test framework here. It'll be called when done, with a status code indicating whether any tests failed. See https://mochajs.org/api/mocha#run for details.

Presumably you'd just add the message elements to the HTML with CSS hiding them then show one in the above callback (depending on result) + hide again on a new run.

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

No branches or pull requests

1 participant