🚇 Test locally with tunnel proxy
Running test locally can be slow, or running test in machine like CI can be tough.
With crusher, you can enable it with few config. We use cloudflare warp to create tunnel and then use it to test
This can be helpful if you are,
- Testing on local machine: Run test against your local service. Super-fast execution.
- Testing on CI: After building, expose local port to run test.
Enabling tunnel proxy
In <project_dir>/.crusher/config.js
add following code, and restart crusher
"proxy": [{
"name": "frontend",
"url": "http://localhost:3000/", // <-- Url of your local service
"intercept": "localhost:3000" // <-- Url our
}]
Example: Check sample config file with proxy.
How will it work?
- A local tunnel will be created using cloudflare argo.
- Test runner will use that tunnel to run test, and intercept requests made to localhost:3000 and re-route to the tunnel.
FAQ
- Is using tunnel proxy required?
No, If you're running test locally one by one. If you're running test on CI, this can be the simplest way to test. - Is this alternative to preview env?
Yes. - Is proxy secure?
Proxy is e2e secured by cloudflare argo. If you have business use case, get in touch to learn more. We will add support for private namespace in future