does this make sense? like the main benefit would be that the discord bot wouldnt be using http call
does this make sense? like the main benefit would be that the discord bot wouldnt be using http calls to communicate with the worker
scheluded in my test I did this:ScheduledEvent but I didn't find anyway to mock those. The only related mocking function seems to be createScheduledController but it's type is ScheduledController which is similiar but not the same.ScheduledController or ScheduledEvent typing in the scheduled event and by following this stackoverflow answer on testing the logging: https://stackoverflow.com/questions/76042978/in-vitest-how-do-i-assert-that-a-console-log-happenedexport const sleep = (ms: number): Promise<void> => {
return new Promise<void>((resolve) => setTimeout(resolve, ms));
};

(warn) Log size limit exceeded: More than 128KB of data (across console.log statements, exception, request metadata and headers) was logged during a single request. Subsequent data for this request will not be recorded in logs, appear when tailing this Worker's logs, or in Tail Workers.
because it did so much at once lol
scheludedScheduledEventScheduledEventcreateScheduledController ScheduledControllerScheduledControllerexport const sleep = (ms: number): Promise<void> => {
return new Promise<void>((resolve) => setTimeout(resolve, ms));
}; (warn) Log size limit exceeded: More than 128KB of data (across console.log statements, exception, request metadata and headers) was logged during a single request. Subsequent data for this request will not be recorded in logs, appear when tailing this Worker's logs, or in Tail Workers.
async scheduled(event: ScheduledEvent, env: Env, ctx: ExecutionContext): Promise<void> {
console.log('This is a scheduled event');
},it("scheduled event logs 'This is a scheduled event'", async () => {
const controller = createScheduledController({
scheduledTime: new Date(1000),
cron: "30 * * * *",
});
const ctx = createExecutionContext();
await worker.scheduled(controller, env, ctx);
await waitOnExecutionContext(ctx);
expect(ctx.log).toMatchInlineSnapshot(`"This is a scheduled event"`);
});