Sveltekit and Cloudflare seem to be a great match. My objective is to deliver well-tested code, that runs smoothly on Cloudflare pages/workers. To do this, I use Cypress.io for e2e testing. The problem is that I can't trust the tests running locally, as using any Node.js API works fine locally (for example Buffer.from
). But this code breaks the site when deploying to Cloudflare.
How can I run the Sveltekit project locally to ensure it will work once deployed?
As a bonus, would it somehow be possible to configure the typescript project so it would throw errors when accessing Node.js API's? According to this Cloudflare page, workers are running a v8 instance. We are using the "official" adapter.
Thanks for your help.