**test(tests): improve isolation and enhance test configuration**

- **Test Enhancements**:
  - Refactored test setup in `core.test.ts` for better isolation and clarity:
    - Added explicit `.clear()` calls to ensure clean state between tests.
    - Replaced old vector addition logic with simplified data insertion methods.
    - Updated search operations to reflect current functionality and debug-friendly output.
  - Introduced the `@vitest-environment jsdom` annotation in `environment.browser.test.ts` for accurate browser environment emulation.

- **Configuration Updates**:
  - Enhanced `vitest.config.ts`:
    - Introduced custom `reporters` for cleaner and focused test result presentation.
    - Expanded console log filtering with additional patterns for reducing noise from TensorFlow.js and setup processes.

- **Purpose**:
  - These updates improve test clarity, consistency, and robustness while streamlining the configuration to minimize distractions in test outputs.
This commit is contained in:
David Snelling 2025-07-16 13:08:41 -07:00
parent 238831af23
commit ad4af27385
3 changed files with 61 additions and 18 deletions

View file

@ -1,6 +1,7 @@
/**
* Browser Environment Tests
* Tests Brainy functionality in browser environment as a consumer would use it
* @vitest-environment jsdom
*/
import { describe, it, expect, beforeAll, vi } from 'vitest'