To run the Python tests:
pytestFor coverage information:
pytest --cov=numerousThe client-side JavaScript code (numerous.js) can be tested using Jest. To run the JavaScript tests:
- Install Node.js if you don't have it already
- Install the required npm dependencies:
npm install- Run the tests:
npm testFor coverage information:
npm test -- --coverageThe JavaScript tests cover the following functionality:
WidgetModelclass for managing widget stateWebSocketManagerfor handling WebSocket communication- Utility functions for logging and debugging
JavaScript tests are automatically run:
- As part of the pre-commit hooks when pushing code
- In the GitHub CI/CD pipeline for every push to the repository
- Coverage reports are generated and archived as artifacts in GitHub Actions
For more details on the JavaScript testing setup, see tests/js/README.md.
Both Python and JavaScript tests are included in the pre-commit workflow:
- Python tests run automatically before pushing code
- JavaScript tests run automatically before pushing code
To install the pre-commit hooks:
pre-commit install --hook-type pre-commit --hook-type pre-pushThis ensures that all tests pass before code is pushed to the repository.