Skip to content

Commit 9d137ac

Browse files
committed
use test env connection
1 parent c92aab3 commit 9d137ac

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

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

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,23 +1669,17 @@ test('Workflow can be started eagerly with shared NativeConnection', async (t) =
16691669
test('Error thrown when requestEagerStart is used with regular Connection', async (t) => {
16701670
const { taskQueue } = helpers(t);
16711671

1672-
// Create a regular connection instead of native
1673-
const regularConnection = await Connection.connect();
1674-
const client = new WorkflowClient({ connection: regularConnection });
1672+
const client = new WorkflowClient({ connection: t.context.env.connection });
16751673

1676-
try {
1677-
await t.throwsAsync(
1678-
client.start(helloWorkflow, {
1679-
args: ['Temporal'],
1680-
workflowId: `eager-workflow-error-${randomUUID()}`,
1681-
taskQueue,
1682-
requestEagerStart: true,
1683-
}),
1684-
{
1685-
message: /Eager workflow start requires a NativeConnection/,
1686-
}
1687-
);
1688-
} finally {
1689-
await regularConnection.close();
1690-
}
1674+
await t.throwsAsync(
1675+
client.start(helloWorkflow, {
1676+
args: ['Temporal'],
1677+
workflowId: `eager-workflow-error-${randomUUID()}`,
1678+
taskQueue,
1679+
requestEagerStart: true,
1680+
}),
1681+
{
1682+
message: /Eager workflow start requires a NativeConnection/,
1683+
}
1684+
);
16911685
});

0 commit comments

Comments
 (0)