Testing utilities and sample data for Workglow AI task pipelines.
The @workglow/test package provides testing utilities, sample data, and in-memory implementations for developing and testing Workglow AI applications. It includes mock repositories, sample task configurations, and helper functions for setting up test environments.
- In-Memory Repositories: Mock implementations of task graph and output repositories for testing
- Sample Data: Pre-configured sample tasks and workflows for testing and development
- Test Bindings: Helper functions for setting up test environments
- Multi-Platform Support: Works in browser, Node.js, and Bun environments
npm install @workglow/test
# or
bun add @workglow/testimport { InMemoryTaskGraphRepository, InMemoryTaskOutputRepository } from "@workglow/test";
// Create in-memory repositories for testing
const taskGraphRepo = new InMemoryTaskGraphRepository();
const taskOutputRepo = new InMemoryTaskOutputRepository();import { registerHuggingfaceLocalModels, registerMediaPipeTfJsLocalModels } from "@workglow/test";
// Register sample AI models for testing
await registerHuggingfaceLocalModels();
await registerMediaPipeTfJsLocalModels();import { registerHuggingFaceTransformersInline } from "@workglow/ai-provider/hf-transformers/runtime";
// Set up HuggingFace Transformers inline for testing
await registerHuggingFaceTransformersInline();InMemoryTaskGraphRepository- In-memory implementation of task graph storageInMemoryTaskOutputRepository- In-memory implementation of task output storageIndexedDbTaskGraphRepository- Browser-based IndexedDB storage for task graphsIndexedDbTaskOutputRepository- Browser-based IndexedDB storage for task outputs
registerHuggingfaceLocalModels()- Registers sample HuggingFace modelsregisterMediaPipeTfJsLocalModels()- Registers sample MediaPipe TensorFlow.js models
This package depends on other Workglow packages:
@workglow/ai@workglow/ai-provider@workglow/job-queue@workglow/storage@workglow/task-graph@workglow/tasks@workglow/util
Apache 2.0 - See LICENSE for details.