Help setting up tests for Durable
Help setting up tests for Durable Objects. reference: https://github.com/withastro/astro/pull/8654
1 Reply
@MrBBot thx for helping out!
If I understand it correctly, the Durable Object Class (e.g.
DurableObjectExample
), needs to be in the worker script. But given that is a automatic SSR bundle for Astro, I really don't know how to write/create a durable object in that case. I think the main usage would be to have access to durable objects which you deploy seperate to your CF Pages Astro site, but then how would that work for local dev or unit testing?
Please ask, if anything unclear.
ohh nvm.. maybe I did something wrong. My wrangler had a "placeholder" script_name
included (https://developers.cloudflare.com/durable-objects/get-started/#5-configure-durable-object-bindings). Just removing the script_name
it seems to work, now!