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.

56 lines
1.6 KiB
Markdown

+++
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"]
+++
<context>
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
</context>
<goal>
Add integration test dev-dependencies to `Cargo.toml` under `[dev-dependencies]`:
```toml
[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.
</goal>
<constraints>
- 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::<T>()` response deserialization.
</constraints>
<skills>
Use `superpowers:verification-before-completion` — run `cargo check` after adding deps to confirm they resolve.
</skills>
<validation>
Run in order from the `quotesdb/` directory:
```sh
cargo fmt
cargo check
cargo clippy
cargo test
```
</validation>
<commit>
`chore(quotesdb): add integration test dev-dependencies (reqwest, tokio, serde_json, tempfile)`
</commit>