@flowforgejs/test-utils
v0.1.4
Published
Testing utilities for FlowForge node authors
Downloads
223
Readme
@flowforgejs/test-utils
Testing utilities for FlowForge nodes and workflows. Provides mock contexts, loggers, and a test runner that integrates with Vitest.
Key exports: createMockContext(), mockLogger, TestRunner
Install
npm install -D @flowforgejs/test-utilsQuick Example
import { describe, it, expect } from 'vitest';
import { createMockContext, mockLogger } from '@flowforgejs/test-utils';
import { myCustomNode } from '../src/nodes/my-custom-node';
describe('myCustomNode', () => {
it('transforms input correctly', async () => {
const ctx = createMockContext({
input: { text: 'hello world' },
logger: mockLogger,
});
const result = await myCustomNode.run(ctx);
expect(result.output).toBe('HELLO WORLD');
expect(mockLogger.info).toHaveBeenCalled();
});
});