Skip to content

Commit b22143a

Browse files
committed
use test env connection
1 parent 956beef commit b22143a

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
@@ -1763,23 +1763,17 @@ test('Workflow can be started eagerly with shared NativeConnection', async (t) =
17631763
test('Error thrown when requestEagerStart is used with regular Connection', async (t) => {
17641764
const { taskQueue } = helpers(t);
17651765

1766-
// Create a regular connection instead of native
1767-
const regularConnection = await Connection.connect();
1768-
const client = new WorkflowClient({ connection: regularConnection });
1766+
const client = new WorkflowClient({ connection: t.context.env.connection });
17691767

1770-
try {
1771-
await t.throwsAsync(
1772-
client.start(helloWorkflow, {
1773-
args: ['Temporal'],
1774-
workflowId: `eager-workflow-error-${randomUUID()}`,
1775-
taskQueue,
1776-
requestEagerStart: true,
1777-
}),
1778-
{
1779-
message: /Eager workflow start requires a NativeConnection/,
1780-
}
1781-
);
1782-
} finally {
1783-
await regularConnection.close();
1784-
}
1768+
await t.throwsAsync(
1769+
client.start(helloWorkflow, {
1770+
args: ['Temporal'],
1771+
workflowId: `eager-workflow-error-${randomUUID()}`,
1772+
taskQueue,
1773+
requestEagerStart: true,
1774+
}),
1775+
{
1776+
message: /Eager workflow start requires a NativeConnection/,
1777+
}
1778+
);
17851779
});

0 commit comments

Comments
 (0)