You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.6 KiB

+++ title = "Set up tests/Cargo.toml with integration test dependencies (reqwest/hyper, tokio, serde_json)" priority = 8 status = "todo" ticket_type = "task" dependencies = ["0d84fa", "fba598"] +++

Integration tests live in `tests/` and exercise the API binary against a temporary SQLite database. They run with `cargo test` and must not require a running Cloudflare environment.

Triage decisions:

  • 0d84fa: HTTP client → reqwest with tokio::test
  • fba598: Isolation strategy → per-test temp SQLite file via tempfile crate
Add integration test dev-dependencies to `Cargo.toml` under `[dev-dependencies]`:
[dev-dependencies]
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }
serde_json = "1"
tempfile = "3"

Confirm cargo check passes after adding these.

- Dev-dependencies do not need WASM compatibility — they are host-only. - Use `#[tokio::test]` for async test functions. - `tempfile` is required by the test harness isolation strategy (ticket fba598 / 9b581f). - `reqwest` must include the `json` feature for `.json()` request body and `.json::()` response deserialization. Use `superpowers:verification-before-completion` — run `cargo check` after adding deps to confirm they resolve. Run in order from the `quotesdb/` directory:
cargo fmt
cargo check
cargo clippy
cargo test
`chore(quotesdb): add integration test dev-dependencies (reqwest, tokio, serde_json, tempfile)`