Closed hhoughgg closed 3 weeks ago
EDIT: Just realized this is the same issue as: https://github.com/cloudflare/workers-sdk/issues/5726
Workers Vitest Integration
1.5.0 [vitest], 0.3.0 [vitest-workers-pool]
v20.13.1
Sonoma 14.5
Error: Handler does not export a fetch() function. When using SELF with vitest and WorkerEntrypoint
Error: Handler does not export a fetch() function.
Vitest should work with WorkerEntrypoint not just export default fetch.
Does not work:
export default class extends WorkerEntrypoint<Env> { async fetch(request: Request) { return app.fetch(request, this.env, this.ctx)} }
Works:
export default { async fetch(request: Request): Promise<Response> { return app.fetch(request) } }
No response
I believe this was fixed here https://github.com/cloudflare/workers-sdk/pull/5916 on vitest 0.4.4
EDIT: Just realized this is the same issue as: https://github.com/cloudflare/workers-sdk/issues/5726
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What version(s) of the tool(s) are you using?
1.5.0 [vitest], 0.3.0 [vitest-workers-pool]
What version of Node are you using?
v20.13.1
What operating system and version are you using?
Sonoma 14.5
Describe the Bug
Observed behavior
Error: Handler does not export a fetch() function.
When using SELF with vitest and WorkerEntrypointExpected behavior
Vitest should work with WorkerEntrypoint not just export default fetch.
Steps to reproduce
Does not work:
Works:
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response