-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Copy link
Labels
bugSomething that isn't workingSomething that isn't workingvitestRelating to the Workers Vitest integrationRelating to the Workers Vitest integration
Description
Which Cloudflare product(s) does this pertain to?
Wrangler, Workers Vitest Integration
What versions are you using?
3.100.0 [Wrangler], 20.11.1 [Node]
What operating system and version are you using?
Mac 15.1.1
Please provide a link to a minimal reproduction
https://github.com/its-jman/rpc-error-repro
Describe the Bug
With a durable object, and vitest integration as simple as:
export class MyDurable extends DurableObject {
async myCustomFunc() { throw new Error("My impl is broken") }
}
And running tests through the vitest integration:
it('fetches feed', async () => {
const stub = env.MY_DURABLE.get(env.MY_DURABLE.idFromName('main'))
const res = await expect(() => stub.myCustomFunc()).rejects.toThrowError()
})
I end up with Vitest caught 1 unhandled error during the test run., and Failed to pop isolated storage stack frame
I'd expect this to be propagated up through rpc as it is mentioned in the docs here so Vitest can handle it.
Why doesn't this error propagate to get handled by Vitest? What is the suggested way to handle thrown errors in implementation in tests?
Please provide any relevant error logs
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't workingvitestRelating to the Workers Vitest integrationRelating to the Workers Vitest integration
Type
Projects
Status
Done