Skip to content

Commit e448279

Browse files
committed
test(testing): key the idempotent Trigger fake by an unambiguous task/key pair
1 parent 0509b49 commit e448279

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/testing/src/mocks/trigger-sdk.mock.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function createIdempotentTasksTrigger() {
9898
let runCount = 0
9999
return async (taskId: string, _payload?: unknown, options?: unknown): Promise<unknown> => {
100100
const key = (options as { idempotencyKey?: unknown } | undefined)?.idempotencyKey
101-
const scopedKey = typeof key === 'string' ? `${taskId}:${key}` : null
101+
const scopedKey = typeof key === 'string' ? JSON.stringify([taskId, key]) : null
102102
const existing = scopedKey ? runIdByKey.get(scopedKey) : undefined
103103
if (existing) return { id: existing }
104104
runCount += 1

0 commit comments

Comments
 (0)