Skip to content
Plugin
Cypress
plugins: [pluginCypress()]
Officialv5.0.9kubb >=5.8.0node >=22

Cypress

@kubb/plugin-cypress

Generates a typed cy.request() wrapper per OpenAPI operation so your Cypress tests call the API through generated helpers and catch broken calls at compile time.

kubb add plugin-cypress
cypresse2e-testingapi-testingtest-generationcodegenopenapi

Generates a typed cy.request() helper for each operation in your OpenAPI spec. Your Cypress tests call the API through these helpers, so a broken call fails at compile time instead of at run time.

Each helper takes grouped path, query, headers, and body parameters and returns the typed response body.

Installation

bun add -d @kubb/plugin-cypress

Or run kubb add plugin-cypress to install the version the Kubb registry pins and add pluginCypress() to kubb.config.ts.

Setup

  • Add @kubb/plugin-ts for the request and response types.
  • The generated helpers need Cypress v13 or higher.

Options worth knowing

  • baseURL is prepended to every request.

Dependencies

No extension dependencies.