Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.32 KB

File metadata and controls

43 lines (29 loc) · 1.32 KB

AI-70: Implement Test Suite for ai-database Package

This PR implements a comprehensive test suite for the ai-database package as described in ticket AI-70. The package previously had no tests, and this PR adds test infrastructure and tests for database configuration, collections, workflows, and AI integrations.

Changes

  • Set up Vitest configuration for the ai-database package
  • Updated package.json with test scripts and dependencies
  • Created a test directory structure mirroring the src structure
  • Implemented unit tests for database configuration with vector embedding support
  • Implemented unit tests for collections (Functions, Generations)
  • Implemented integration tests for workflows (executeFunction)
  • Set up proper mocking for external dependencies (AI services)
  • Added test documentation in README.md

Test Strategy

  • Unit Tests: Test individual components in isolation (collections, database config, AI lib)
  • Integration Tests: Test workflows with mocked dependencies
  • Mocking: Mock AI service responses for deterministic testing

How to Test

Run the tests using:

cd packages/ai-database
pnpm test

For test coverage:

pnpm test:coverage

Link to Devin run

https://app.devin.ai/sessions/38091bd156dd40ca8545d1f85b8fa6e2

Requested by

Nathan Clevenger (nateclev@gmail.com)