Skip to content

Conversation

@CodeWithBehnam
Copy link
Owner

Summary

  • Sets up Vitest as the testing framework with jsdom environment
  • Adds 27 unit tests for core modules:
    • workflow-storage.ts: 13 tests for localStorage, autosave, import/export
    • graph-executor.ts: 14 tests for execution engine, topological sort, node modes

Test Coverage

  • Workflow serialisation and deserialisation
  • Local storage save/load with quota handling
  • Large data stripping for autosave
  • File import/export functionality
  • Graph execution ordering (Kahn's algorithm)
  • Muted and bypassed node handling
  • Progress calculation
  • Error handling and propagation
  • Execution cancellation
  • Partial execution methods
  • Execution isolation for concurrent runs

New Files

  • vitest.config.ts - Test configuration
  • src/test/setup.ts - Test environment mocks
  • src/lib/workflow-storage.test.ts - 13 tests
  • src/lib/graph-executor.test.ts - 14 tests

Scripts Added

  • bun run test - Run tests in watch mode
  • bun run test:run - Run tests once
  • bun run test:coverage - Run with coverage report

Behnam Ebrahimi

- Add vitest.config.ts with jsdom environment, React plugin, and coverage
- Create test setup with mocks for ResizeObserver, matchMedia, localStorage
- Add workflow-storage.test.ts with 13 tests for localStorage, autosave,
  import/export functionality
- Add graph-executor.test.ts with 14 tests for execution engine:
  - Topological ordering
  - Muted/bypassed node handling
  - Progress calculation
  - Error handling
  - Execution cancellation
  - Partial execution (executeFromNode, executeNodeOnly)
  - Execution isolation

All 27 tests pass. Coverage configured with v8 provider.

Co-Authored-By: Behnam & Claude Code
@CodeWithBehnam CodeWithBehnam merged commit c8b25a5 into main Dec 25, 2025
1 of 2 checks passed
@CodeWithBehnam CodeWithBehnam deleted the test/vitest-setup branch December 25, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants