Package {mochita}


Title: Test R Web Applications
Version: 1.0.0
Description: Write so-called 'Integration Tests' for your R web applications by declaring an HTTP request and the expectations its response should meet.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 8.0.0
Imports: httpuv, nanonext (≥ 1.10.1), R6, testthat (≥ 3.0.0)
Config/testthat/edition: 3
Suggests: routing, yyjsonr
URL: https://github.com/JulioCollazos64/mochita
BugReports: https://github.com/JulioCollazos64/mochita/issues
NeedsCompilation: no
Packaged: 2026-07-29 04:03:52 UTC; julio
Author: Julio Collazos [aut, cre], supertest contributors [ctb, cph] (authors listed in <https://github.com/forwardemail/supertest/graphs/contributors>)
Maintainer: Julio Collazos <amarullazo626@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-06 13:40:02 UTC

mochita: Test R Web Applications

Description

Write so-called 'Integration Tests' for your R web applications by declaring an HTTP request and the expectations its response should meet.

Author(s)

Maintainer: Julio Collazos amarullazo626@gmail.com

Authors:

Other contributors:

See Also

Useful links:


Test an HTTP server

Description

mochita() builds the specification for testing an httpuv app. It returns a Mochita object whose methods can be chained together to build up a request, describe the expectations it should meet, and finally send it with ⁠$perform()⁠.

Usage

mochita(app)

Arguments

app

App definition, see httpuv::startServer.

Value

A Mochita R6 class object.

Mochita Methods

A Mochita is an R6 Class with the following methods:

Examples

## Not run: 
mochita(app)$get("/")$
  set("Accept", "text/plain")$
  expect(200)$
  expect("Content-Type", "text/plain")$
  perform()

## End(Not run)

mirror server hosted at Truenetwork, Russian Federation.