configure cypress.config.js e2e and component testingtype blocks separately in cypress v13+

domain: docs.cypress.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. define separate e2e and component top-level keys inside the object passed to defineConfig() in cypress.config.js
  2. put e2e-only options (baseUrl, e2e setupNodeEvents) inside the e2e block, and component-only options (devServer, specPattern for components) inside the component block
  3. configure the component block's devServer (e.g. { framework: 'react', bundler: 'vite' }) to match the project's actual frontend tooling
  4. use Cypress.testingType inside a shared setupNodeEvents function to branch logic that differs between 'e2e' and 'component' runs
  5. launch each mode explicitly (cypress run --e2e or cypress run --component) to confirm the correct block's configuration and spec pattern are picked up

Known gotchas

Related routes

pierce shadow dom in cypress tests using the includeshadowdom configuration option
docs.cypress.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans