Fix useTaskTrigger queue option params and remove exportName from e2e tests

This commit is contained in:
Eric Allam
2025-03-21 12:20:44 +00:00
parent 941e03b3eb
commit cbe651e7e4
2 changed files with 6 additions and 15 deletions
+5 -14
View File
@@ -10,7 +10,7 @@ export interface TestCaseRun {
task: {
id: string;
filePath: string;
exportName: string;
exportName?: string;
};
payload: string;
payloadType?: string;
@@ -59,7 +59,6 @@ export const fixturesConfig: TestCase[] = [
{
id: "helloWorld",
filePath: "src/trigger/helloWorld.ts",
exportName: "helloWorld",
},
],
},
@@ -93,13 +92,12 @@ export const fixturesConfig: TestCase[] = [
{
id: "ai",
filePath: "src/trigger/ai.ts",
exportName: "aiTask",
},
],
},
runs: [
{
task: { id: "ai", filePath: "src/trigger/ai.ts", exportName: "aiTask" },
task: { id: "ai", filePath: "src/trigger/ai.ts" },
payload: '{"prompt":"be funny"}',
result: { ok: true, durationMs: 1 },
},
@@ -126,17 +124,12 @@ export const fixturesConfig: TestCase[] = [
{
id: "decoratorsTask",
filePath: "src/trigger/decorators.ts",
exportName: "decoratorsTask",
},
],
},
runs: [
{
task: {
id: "decoratorsTask",
filePath: "src/trigger/decorators.ts",
exportName: "decoratorsTask",
},
task: { id: "decoratorsTask", filePath: "src/trigger/decorators.ts" },
payload: "{}",
result: { ok: true, durationMs: 1 },
},
@@ -162,13 +155,12 @@ export const fixturesConfig: TestCase[] = [
{
id: "react-email",
filePath: "src/reactEmail.tsx",
exportName: "reactEmail",
},
],
},
runs: [
{
task: { id: "react-email", filePath: "src/reactEmail.tsx", exportName: "reactEmail" },
task: { id: "react-email", filePath: "src/reactEmail.tsx" },
payload: "{}",
result: {
ok: true,
@@ -200,13 +192,12 @@ export const fixturesConfig: TestCase[] = [
{
id: "helloWorld",
filePath: "src/trigger/helloWorld.ts",
exportName: "helloWorld",
},
],
},
runs: [
{
task: { id: "helloWorld", filePath: "src/trigger/helloWorld.ts", exportName: "helloWorld" },
task: { id: "helloWorld", filePath: "src/trigger/helloWorld.ts" },
payload: "{}",
result: { ok: true, durationMs: 1 },
},
@@ -75,7 +75,7 @@ export function useTaskTrigger<TTask extends AnyTask>(
const handle = await apiClient.triggerTask(id, {
payload: payloadPacket.data,
options: {
queue: options?.queue,
queue: options?.queue ? { name: options.queue } : undefined,
concurrencyKey: options?.concurrencyKey,
payloadType: payloadPacket.dataType,
idempotencyKey: await makeIdempotencyKey(options?.idempotencyKey),