UNPKG

dspy.ts

Version:

DSPy.ts - Declarative Self-Learning TypeScript: A framework for compositional LM pipelines with self-improving prompt strategies.

19 lines (12 loc) 1.23 kB
A comprehensive Jest testing implementation strategy for DSPy.ts. - **EndtoEnd (E2E) Testing:** Simulate real user flows by constructing a small DSPy.ts pipeline (using multiple modules) and verifying that the entire flow—from input through LM inference to output parsing—produces the expected result. - **Mocking External Dependencies:** Use Jest's mocking features to simulate asynchronous LM calls and external API behaviors (for instance, by stubbing the ONNX InferenceSession). This helps isolate testing of DSPy.ts logic from model-specific behavior. ``` DSPy.ts/ ├── src/ - **Objective:** Verify that a full DSPy.ts pipeline—from module definitions through global LM configuration—executes correctly. - **Focus:** This comprehensive Jest testing strategy for DSPy.ts ensures that each component—from core modules and LM drivers to utility functions and full pipelines—is thoroughly validated. By following these guidelines, developers will achieve robust unit, integration, and endtoend tests that help maintain high quality and confidence in the DSPy.ts SDK. This strategy should serve as a detailed blueprint for implementing and maintaining a rigorous Jest testing suite in DSPy.ts.