httptest
4.2.3A Test Environment for HTTP Requests
Overview
Testing and documenting code that communicates with remote servers can be painful. Dealing with authentication, server state, and other complications can make testing seem too costly to bother with. But it doesn't need to be that hard. This package enables one to test all of the logic on the R sides of the API in your package without requiring access to the remote service. Importantly, it provides three contexts that mock the network connection in different ways, as well as testing functions to assert that HTTP requests were---or were not---made. It also allows one to safely record real API responses to use as test fixtures. The ability to save responses and load them offline also enables one to write vignettes and other dynamic documents that can be distributed without access to a live server.
Install
Health
- NOTE r-devel-linux-x86_64-debian-clang
- NOTE r-devel-linux-x86_64-debian-gcc
- NOTE r-devel-linux-x86_64-fedora-clang
- NOTE r-devel-linux-x86_64-fedora-gcc
- NOTE r-devel-windows-x86_64
- NOTE2026-07-1611 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- OK2026-06-0913 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- ERROR2026-06-0812 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
- OK2026-03-1014 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Documentation
- Examples that run
- 83%
- Documented parameters
- 98%
- Return-value docs
- 96%
- References docs
- 0%
Downloads
Repository
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Repository practices
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/nealrichardson/httptest on 2026-07-19.
Dependencies
and 7 more packages.
Code & Tests
- Cyclomatic complexity
- 2.0 median / 10 max
- Test cases
- 136 / 1.44 per code line
Test coverage
Line coverage
98%
Expression
98.0%
Tests / Examples
98.0% / 27% ex
Functions
77 39 exported
Complexity
2.2 avg / 10 max
Call network
77 nodes / 98 edges
Call graph
Open call graph →Lowest coverage
77 functions| Function | Cyclo | Coverage |
|---|---|---|
| save_response exp | 10 | 82% |
| capture_requests exp | 2 | 83% |
| find_mock_file exp | 6 | 93% |
| start_capturing exp | 4 | 95% |
| .mockPaths exp | 3 | 100% |
| block_requests exp | 1 | 100% |
People & History
20 releases. Pick two to compare their code metrics. R releases are shown for context.
- RR 4.6.0 released · 2026-04-24
- 4.2.3Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 4.2.22024-01-23 · diff ↗
- 4.2.12023-06-12 · diff ↗
- 4.2.02023-05-29 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 4.1.02021-09-22 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 4.0.02021-02-01 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 3.3.02020-01-28 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 3.2.22018-12-07 · diff ↗
Show 15 earlier events
- 3.2.02018-11-09 · diff ↗
- 3.1.02018-06-19 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 3.0.02018-01-16 · diff ↗
- 2.3.42017-11-14 · diff ↗
- 2.3.22017-10-20 · diff ↗
- 2.1.22017-08-05 · diff ↗
- 2.1.02017-07-31 · diff ↗
- 2.0.02017-06-05 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 1.3.02017-04-13 · diff ↗
- 1.2.02017-03-22 · diff ↗
- 1.1.02017-02-03 · diff ↗
- 1.0.02016-12-31
- RR 3.3.0 released · 2016-05-03
Package metadata
- First published
- 2016-12-31
- Total releases
- 20 / 10 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 118 KB
- Installed size
- not tracked yet
- With dependencies
- not tracked yet