Skip to content

Commit 8b3b991

Browse files
committed
add antonio test
1 parent c9b2b9d commit 8b3b991

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/test/src/test-integration-workflows.ts

+24
Original file line numberDiff line numberDiff line change
@@ -1389,3 +1389,27 @@ test('root execution is exposed', async (t) => {
13891389
t.true(childWfInfoRoot?.runId === parentDesc.runId);
13901390
});
13911391
});
1392+
1393+
export async function rootWorkflow(): Promise<string> {
1394+
let result = '';
1395+
if (!workflow.workflowInfo().rootWorkflow) {
1396+
result += 'empty';
1397+
} else {
1398+
result += workflow.workflowInfo().rootWorkflow!.workflowId;
1399+
}
1400+
if (!workflow.workflowInfo().parent) {
1401+
result += ' ';
1402+
result += await workflow.executeChild(rootWorkflow, { args: [] });
1403+
}
1404+
return result;
1405+
}
1406+
1407+
test('Workflow can return root workflow', async (t) => {
1408+
const { createWorker, startWorkflow } = helpers(t);
1409+
const worker = await createWorker();
1410+
await worker.runUntil(async () => {
1411+
const handle = await startWorkflow(rootWorkflow, { workflowId: 'test-root-workflow-length', args: [] });
1412+
const result = await handle.result();
1413+
t.deepEqual(result, 'empty test-root-workflow-length');
1414+
});
1415+
});

0 commit comments

Comments
 (0)