{"id":14066224,"url":"https://github.com/nealrichardson/httptest2","last_synced_at":"2025-09-24T08:31:38.500Z","repository":{"id":38457430,"uuid":"432830576","full_name":"nealrichardson/httptest2","owner":"nealrichardson","description":"Utilities for testing R 📦s that use httr2","archived":false,"fork":false,"pushed_at":"2024-07-16T14:58:13.000Z","size":864,"stargazers_count":27,"open_issues_count":9,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T00:39:48.300Z","etag":null,"topics":["http","mock","r","testing"],"latest_commit_sha":null,"homepage":"https://enpiar.com/httptest2/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nealrichardson.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-28T21:34:55.000Z","updated_at":"2024-10-08T09:59:33.000Z","dependencies_parsed_at":"2024-12-17T19:06:55.169Z","dependency_job_id":"a287984f-9fb3-43bb-b033-c3e008f71e8b","html_url":"https://github.com/nealrichardson/httptest2","commit_stats":{"total_commits":286,"total_committers":12,"mean_commits":"23.833333333333332","dds":0.07692307692307687,"last_synced_commit":"5856ed57a5985b9ffede754601fe2bd501a19b09"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nealrichardson%2Fhttptest2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nealrichardson%2Fhttptest2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nealrichardson%2Fhttptest2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nealrichardson%2Fhttptest2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nealrichardson","download_url":"https://codeload.github.com/nealrichardson/httptest2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234059265,"owners_count":18773061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","mock","r","testing"],"created_at":"2024-08-13T07:04:59.813Z","updated_at":"2025-09-24T08:31:37.922Z","avatar_url":"https://github.com/nealrichardson.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# httptest2: Test Helpers for 'httr2'\n\n[![Build Status](https://github.com/nealrichardson/httptest2/workflows/R-CMD-check/badge.svg)](https://github.com/nealrichardson/httptest2/actions)\n[![codecov](https://codecov.io/gh/nealrichardson/httptest2/branch/main/graph/badge.svg?token=PxOGymudAS)](https://app.codecov.io/gh/nealrichardson/httptest2)\n\n`httptest2` makes it easy to write tests for code and packages that wrap web APIs.\nTesting code that communicates with remote servers can otherwise be painful: things like authentication, server state, and network flakiness can make testing seem too costly to bother with. The `httptest2` package enables you to test all of the logic on the R sides of the API in your package without requiring access to the remote service.\n\nImportantly, it provides **contexts** that mock the network connection and tools for **recording** real requests for future offline use as fixtures, both in tests and in vignettes. The package also includes additional **expectations** to assert that HTTP requests were---or were not---made.\n\nUsing these tools, you can test that code is making the intended requests and that it handles the expected responses correctly, all without depending on a connection to a remote API. The ability to save responses and load them offline also enables you to write package vignettes and other dynamic documents that can be distributed without access to a live server.\n\nThis package is an adaptation of [`httptest`](https://enpiar.com/r/httptest/) to work with [`httr2`](https://httr2.r-lib.org/). Most features work exactly as they do in `httptest`; see the NEWS.md for the initial release for a summary of what has changed.\n\n## Installing\n\n`httptest2` can be installed from CRAN with\n\n```r\ninstall.packages(\"httptest2\")\n```\n\nThe pre-release version of the package can be pulled from GitHub using the [remotes](https://github.com/r-lib/remotes) package:\n\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"nealrichardson/httptest2\")\n```\n\n## Getting started\n\nTo start using `httptest2` with your package, run `use_httptest2()` in the root of your package directory. This will\n\n* add `httptest2` to \"Suggests\" in the DESCRIPTION file\n* add `library(httptest2)` to `tests/testthat/setup.R`, which `testthat` loads before running tests\n\nThen, you're ready to start using the tools that `httptest2` provides. For an overview of how to get started, see `vignette(\"httptest2\")`, and check out `vignette(\"faq\")` for some common questions. See also the [package reference](https://enpiar.com/httptest2/reference/) for a list of all of the test contexts and expectations provided in the package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnealrichardson%2Fhttptest2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnealrichardson%2Fhttptest2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnealrichardson%2Fhttptest2/lists"}