Back to Repositories

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
tests/runtime/test_browsergym_envs.py
unit
python This pytest unit test verifies BrowserGym environment integration and functionality within the OpenHands framework.
tests/runtime/test_browsing.py
unit
python This Python unit test verifies browser-based interactions and command execution functionality in the EventStreamRuntime environment.
frontend/__tests__/utils/storage.test.ts
unit
typescript This Jest unit test verifies the localStorage configuration retrieval and parsing functionality in the frontend utility module.
frontend/__tests__/utils/utils.test.ts
unit
typescript This Vitest unit test verifies utility functions for timestamp formatting, file extension extraction, and API key removal operations.
tests/unit/test_arg_parser.py
unit
python This pytest unit test verifies the argument parser functionality and configuration handling in the OpenHands AI framework.
tests/unit/test_codeact_agent.py
unit
python This pytest unit test verifies the CodeActAgent’s ability to process and format different types of observations into appropriate message structures.
tests/unit/test_observation_serialization.py
unit
python This Python unit test verifies the serialization and deserialization of observation events in the OpenHands framework.
tests/test_fileops.py
unit
python This pytest unit test verifies secure path resolution and workspace directory handling in the OpenHands file operations utility.
tests/unit/test_browsing_agent_parser.py
unit
python This pytest unit test verifies the parsing functionality of browser actions and user messages in the BrowsingResponseParser component.
tests/unit/test_condenser.py
unit
python This pytest unit test verifies the memory condensation functionality and error handling of the MemoryCondenser component.