Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for Addons injection #225

Closed
agjohnson opened this issue Oct 21, 2024 · 1 comment · Fixed by #227
Closed

Add tests for Addons injection #225

agjohnson opened this issue Oct 21, 2024 · 1 comment · Fixed by #227
Assignees
Labels
Accepted Accepted issue on our roadmap Bug A bug Improvement Minor improvement to code

Comments

@agjohnson
Copy link
Contributor

agjohnson commented Oct 21, 2024

The working script would feel sturdier with tests, there's a lot happening in the script that we aren't verifying. I also found it a little hard to guarantee changes would work as expected without any test coverage.

Cloudflare has integration with Vite, which is slightly different than web-test-runner but the test cases do use similar syntax (Jest). We'd want to mock proxied request responses, here is an example to work from:

https://github.com/cloudflare/workers-sdk/blob/main/fixtures/vitest-pool-workers-examples/request-mocking/test/declarative.test.ts

@agjohnson
Copy link
Contributor Author

I just ended up dropping this in, I needed it to verify my changes and even to understand how this library works. Cloudflare adds another layer of confusion too, as some of their implementation is slightly different than Node/browser native Request/Response/etc.

@github-project-automation github-project-automation bot moved this from Needs review to Done in 📍Roadmap Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug A bug Improvement Minor improvement to code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant