Harry
Harry
CDCloudflare Developers
Created by EasyDev on 1/14/2025 in #workers-help
Is it possible to make Vitest code available both locally and in production?
There aren’t loads of differences between Wrangler and actually running on the edge, there are some but in my experience I haven’t needed to test the specific cases of them separately. If you wanted to, you could write another test that actually calls the https://<yourworker>.workers.dev route which tests against production, that’s more of an end to end test than a unit test but might give you the confidence you’re looking for.
5 replies
CDCloudflare Developers
Created by EasyDev on 1/14/2025 in #workers-help
Is it possible to make Vitest code available both locally and in production?
For each test run vitest spins up a local instance of the worker and makes the request against that. What’s the reason for wanting to test “production” too?
5 replies