Skip to content

Commit c43beb4

Browse files
committed
add antonio test
1 parent 31d0219 commit c43beb4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

+23
Original file line numberDiff line numberDiff line change
@@ -1389,3 +1389,26 @@ 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().root) {
1396+
result += 'empty';
1397+
} else {
1398+
result += workflow.workflowInfo().root!.workflowId;
1399+
}
1400+
if (!workflow.workflowInfo().parent) {
1401+
result += ' ';
1402+
result += await workflow.executeChild(rootWorkflow);
1403+
}
1404+
return result;
1405+
}
1406+
1407+
test('Workflow can return root workflow', async (t) => {
1408+
const { createWorker, executeWorkflow } = helpers(t);
1409+
const worker = await createWorker();
1410+
await worker.runUntil(async () => {
1411+
const result = await executeWorkflow(rootWorkflow, { workflowId: 'test-root-workflow-length' });
1412+
t.deepEqual(result, 'empty test-root-workflow-length');
1413+
});
1414+
});

0 commit comments

Comments
 (0)