OpenHands Testing: Jest & Pytest Implementation for Full-Stack Applications
The OpenHands repository demonstrates a comprehensive testing approach utilizing both Jest and Pytest frameworks for thorough unit testing coverage. With over 100 test cases, the codebase showcases modern testing practices across frontend React components and backend Python modules, ensuring robust validation of core functionalities like prompt management, UI interactions, and terminal operations. Qodo Tests Hub provides developers with an organized view into OpenHands' testing patterns, making it easier to understand how different components are tested in a real-world application. Through the hub's interactive interface, developers can explore test implementations for specific features, analyze testing strategies for both frontend and backend components, and learn practical approaches to writing effective unit tests for similar applications.
Path | Test Type | Language | Description |
---|---|---|---|
frontend/__tests__/services/settings.test.ts |
unit
|
typescript | This Jest unit test verifies the storage and retrieval of application settings using localStorage in the OpenHands frontend. |
frontend/__tests__/utils/extract-model-and-provider.test.ts |
unit
|
typescript | This Jest unit test verifies the extraction and parsing of AI model identifiers and providers from various format strings. |
frontend/__tests__/utils/format-ms.test.ts |
unit
|
typescript | This Jest unit test verifies the formatMs utility function’s ability to correctly convert milliseconds into formatted time strings. |
frontend/__tests__/utils/is-number.test.ts |
unit
|
typescript | This Vitest unit test verifies the isNumber utility function’s ability to correctly identify numeric values in both number and string formats. |
frontend/__tests__/utils/organize-models-and-providers.test.ts |
unit
|
typescript | This Vitest unit test verifies the correct organization and categorization of AI model identifiers across different providers with their respective separators. |
frontend/__tests__/utils/parse-github-url.test.ts |
unit
|
typescript | This Vitest unit test verifies the correct parsing and component extraction of GitHub repository URLs. |
frontend/tests/redirect.spec.ts |
unit
|
typescript | This Playwright unit test verifies application routing behavior during project uploads, repository selection, and token-based authentication flows. |
tests/runtime/test_bash.py |
unit
|
python | This pytest unit test verifies bash command execution and process management in the EventStreamRuntime sandbox environment |
tests/runtime/test_env_vars.py |
unit
|
python | This Python unit test verifies environment variable handling and manipulation in the EventStreamRuntime sandbox environment. |
tests/runtime/test_edit.py |
unit
|
python | This pytest unit test verifies file editing operations and diff generation in the EventStreamRuntime system |