Skip to content

Commit cbe651e

Browse files
committed
Fix useTaskTrigger queue option params and remove exportName from e2e tests
1 parent 941e03b commit cbe651e

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

packages/cli-v3/e2e/fixtures.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface TestCaseRun {
1010
task: {
1111
id: string;
1212
filePath: string;
13-
exportName: string;
13+
exportName?: string;
1414
};
1515
payload: string;
1616
payloadType?: string;
@@ -59,7 +59,6 @@ export const fixturesConfig: TestCase[] = [
5959
{
6060
id: "helloWorld",
6161
filePath: "src/trigger/helloWorld.ts",
62-
exportName: "helloWorld",
6362
},
6463
],
6564
},
@@ -93,13 +92,12 @@ export const fixturesConfig: TestCase[] = [
9392
{
9493
id: "ai",
9594
filePath: "src/trigger/ai.ts",
96-
exportName: "aiTask",
9795
},
9896
],
9997
},
10098
runs: [
10199
{
102-
task: { id: "ai", filePath: "src/trigger/ai.ts", exportName: "aiTask" },
100+
task: { id: "ai", filePath: "src/trigger/ai.ts" },
103101
payload: '{"prompt":"be funny"}',
104102
result: { ok: true, durationMs: 1 },
105103
},
@@ -126,17 +124,12 @@ export const fixturesConfig: TestCase[] = [
126124
{
127125
id: "decoratorsTask",
128126
filePath: "src/trigger/decorators.ts",
129-
exportName: "decoratorsTask",
130127
},
131128
],
132129
},
133130
runs: [
134131
{
135-
task: {
136-
id: "decoratorsTask",
137-
filePath: "src/trigger/decorators.ts",
138-
exportName: "decoratorsTask",
139-
},
132+
task: { id: "decoratorsTask", filePath: "src/trigger/decorators.ts" },
140133
payload: "{}",
141134
result: { ok: true, durationMs: 1 },
142135
},
@@ -162,13 +155,12 @@ export const fixturesConfig: TestCase[] = [
162155
{
163156
id: "react-email",
164157
filePath: "src/reactEmail.tsx",
165-
exportName: "reactEmail",
166158
},
167159
],
168160
},
169161
runs: [
170162
{
171-
task: { id: "react-email", filePath: "src/reactEmail.tsx", exportName: "reactEmail" },
163+
task: { id: "react-email", filePath: "src/reactEmail.tsx" },
172164
payload: "{}",
173165
result: {
174166
ok: true,
@@ -200,13 +192,12 @@ export const fixturesConfig: TestCase[] = [
200192
{
201193
id: "helloWorld",
202194
filePath: "src/trigger/helloWorld.ts",
203-
exportName: "helloWorld",
204195
},
205196
],
206197
},
207198
runs: [
208199
{
209-
task: { id: "helloWorld", filePath: "src/trigger/helloWorld.ts", exportName: "helloWorld" },
200+
task: { id: "helloWorld", filePath: "src/trigger/helloWorld.ts" },
210201
payload: "{}",
211202
result: { ok: true, durationMs: 1 },
212203
},

packages/react-hooks/src/hooks/useTaskTrigger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function useTaskTrigger<TTask extends AnyTask>(
7575
const handle = await apiClient.triggerTask(id, {
7676
payload: payloadPacket.data,
7777
options: {
78-
queue: options?.queue,
78+
queue: options?.queue ? { name: options.queue } : undefined,
7979
concurrencyKey: options?.concurrencyKey,
8080
payloadType: payloadPacket.dataType,
8181
idempotencyKey: await makeIdempotencyKey(options?.idempotencyKey),

0 commit comments

Comments
 (0)