Files
sdk/test/test.node.ts
T
2026-05-05 12:03:46 +00:00

15 lines
518 B
TypeScript

import { expect, tap } from '@git.zone/tstest/tapbundle';
import { ShxAutomationContext } from '../ts/index.js';
tap.test('registers and runs automation handlers', async () => {
const context = new ShxAutomationContext({ callerId: 'test' });
let ran = false;
context.on({ id: 'manual:test', kind: 'manual', expression: 'test' }, async () => {
ran = true;
});
await context.runTrigger({ triggerId: 'manual:test', kind: 'manual', payload: {} });
expect(ran).toBeTrue();
});
export default tap.start();