chore: Make scheduled job tests less likely to fail (#8241)

This commit is contained in:
Stevche Radevski
2024-07-23 16:59:27 +02:00
committed by GitHub
parent a9abf448c6
commit bcba5b3a6c
3 changed files with 62 additions and 16 deletions

View File

@@ -5,8 +5,13 @@ import {
StepResponse,
} from "@medusajs/workflows-sdk"
export const createScheduled = (name: string, schedule?: SchedulerOptions) => {
export const createScheduled = (
name: string,
next: () => void,
schedule?: SchedulerOptions
) => {
const workflowScheduledStepInvoke = jest.fn((input, { container }) => {
next()
return new StepResponse({
testValue: container.resolve("test-value"),
})