I’m new to developing Cloudflare Workers and I’m a bit lost.
I’m failing to discover the proper way to write tests.
These blogs posts deal with it: https://blog.cloudflare.com/unit-testing-workers-in-cloudflare-workers/ https://blog.cloudflare.com/unit-testing-worker-functions/ .
The first one offers a way to run tests in the production environment, which I’m quite reluctant to do, to be honest. The second uses a package that is no longer maintained.
I’d like to know if there are some best practices for writing tests for workers. Where should I look for it?
Here are some issues I’m worried about:
- Import syntax
- CORS issues
- Availability of the Web API