-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to migrate Jest unit tests to Miniflare V3? #747
Comments
Hey! 👋 We're actively working on bringing Miniflare 2's unit testing environments to Miniflare 3 (https://github.com/cloudflare/workers-sdk/tree/bcoll/vitest-pool-workers/packages/vitest-pool-workers). We're not quite ready for release yet but getting there. 🙂 Hoping to do an initial pre-release in the next few weeks, or early next year. We're only planning to support Vitest initially though. I'd encourage you to consider migrating (https://vitest.dev/guide/migration.html#migrating-from-jest) when we release this, as Vitest provides better support for TypeScript and ES modules out-of-the-box. I'm going to close this in favour of this tracking issue: cloudflare/workers-sdk#4490. |
We recently started using the
Message.ack()
andMessage.retry()
methods, to explicitly acknowledge processed messages, but when running our local Miniflare tests, we noticed these errors:We thought we were using
[email protected]
(because it's in our devDependencies), but upon closer inspection it turned out we're also using[email protected]
in there, and so it looks like we're actually still working with Miniflare V2 in Jest. We really want to upgrade to Miniflare V3, but it's unclear how to set this up and migrate our existing (and extensive) Jest test suite.What's the replacement for
jest-environment-miniflare
that works with Miniflare V3 / workerd setups?This page also didn't help much. Could you provide any guidance?
The text was updated successfully, but these errors were encountered: