change_state: Handle a change of server state

View source: R/vignette.R

change_stateR Documentation

Handle a change of server state

Description

In a vignette, put a call to change_state() before any code block that makes a change on the server, or rather, before any code block that might repeat the same request previously done and expect a different result.

Usage

change_state()

Details

change_state() works by layering a new directory on top of the existing .mockPaths(), so fixtures are recorded/loaded there, masking rather than overwriting previously recorded responses for the same request. In vignettes, these mock layers are subdirectories with integer names.

Value

Invisibly, the return of .mockPaths() with the new path added.

See Also

start_vignette(); vignette("vignettes", package = "httptest2") for an overview of all


httptest2 documentation built on May 29, 2024, 8:42 a.m.