ariaxu
CDCloudflare Developers
•Created by ariaxu on 8/11/2023 in #workers-help
Trouble testing durable objects with latest wrangler and miniflare/jest in ts
Hi! I added a durable object to my worker project and it's broken my tests.
All of my tests now fail before running with
DurableObjectError [ERR_CLASS_NOT_FOUND]: Class "DurableThing" for Durable Object "DURABLE_THING" not found.
I checked the compiler output and the DurableThing class is not present in the output, which explains why jest/miniflare don't see it. Doing const r = DurableThing;
in my worker doesn't cause it to be included in the compiler output.
Here's my jest config from packages.json:
I'm kinda new to all this; any help would be appreciated. Removing any reference to the durable object from my jest config makes non-DO tests work again.1 replies