cloudflare-docs
cloudflare-docs copied to clipboard
Document how to write tests for workers
I found these two old articles
- https://blog.cloudflare.com/unit-testing-workers-in-cloudflare-workers/
- https://findwork.dev/blog/testing-cloudflare-workers/
And this issue https://github.com/cloudflare/wrangler/issues/1026
Now the wrangler dev
is out of beta, it would be nice to have an official page in docs on how to test workers locally and with CI tools.
yes! we'd like to support this better in the platform. for now, check out the #testing-strategies channel in our discord server to talk w/ folks doing this. leaving this ticket open tho because we eventually want to add content in our docs for this! thanks for filing an issue 👍
Yes, please. Another very promising article on testing Cloudflare Workers uses a package which is no longer maintained: https://blog.cloudflare.com/unit-testing-worker-functions/
Hey all,
Thanks for bringing this up. We're working on an internal solution for testing Workers locally! We'll update our docs as soon as we have something and I've got a list of those outdated resources (thanks for sharing those!) In the meantime, Miniflare is a really cool community project that a lot of people use for that!
cc @grahamlyons @vinaypuppal
I started using Miniflare and it's changed my life. I recommend it highly.
So happy to hear that :)
@lauragift21 I've been leaving this one open because the DevProd team is hard at work on a test runner for Wrangler https://github.com/cloudflare/wrangler2/issues/1183
Whenever that work is completed, we should update the docs with instructions on how to use that!
Sure thanks! @jkup I'll an eye on this issue.
Confirmed this issue is being tracked internally, so closing it out here for now.
https://github.com/cloudflare/cloudflare-docs/pull/6501