Add SDK package
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user