cloudflare / cloudflare/workers-rs
[Feature] Integration Testing
- Dominant language
- Rust
- Stars
- 3.7k
- Forks
- 429
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Description
Is there a way to run integration tests for a worker? I'd like to be able to do something similar to:
```(rust)
async fn health_check_works() {
// Arrange
let worker = spawn_worker().await;
let client = reqwest::Client::new();
// Act
let response = client
.get(&format!("{}/health_check", &worker.address))
.send()
.await
.expect("Failed to execute request.");
// Assert
assert!(response.status().is_success());
assert_eq!(Some(0), response.content_length());
}
```
Contributor guide
Assessment
This issue has not been assessed yet.