cap-test-generator

Generate layered CAP tests for SAP CAP Node.js/TypeScript projects.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/apadern/.github_tailormade --skill cap-test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cap-test-generator
Source: https://github.com/apadern/.github_tailormade/tree/main/skills/cap-test-generator
Command: npx skills add https://github.com/apadern/.github_tailormade --skill cap-test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Genera pruebas CAP por capas para proyectos SAP CAP (Node.js/TypeScript), reduciendo la complejidad de pruebas, aislando el runtime y asegurando contratos, seguridad y datos.

Core Features & Use Cases

  • Genera tests unitarios con mocks para handlers y lógica de negocio.
  • Genera tests de servicio/contrato con @cap-js/cds-test y servidor CAP real.
  • Cubre seguridad con usuarios mock y permisos, validando acceso y restricciones.
  • Soporta pruebas de datos (fixtures CSV) e integración con persistencia real.

Quick Start

Ejecuta el generador de tests CAP para un módulo concreto y revisa los artefactos generados en test/[modulo]/...

Frequently Asked Questions about cap-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate layered tests for SAP CAP Node.js projects?

Generate layered SAP CAP tests by targeting unit, service, auth, data, and integration modes. This produces isolated test code using mocks and @cap-js/cds-test, outputting artifacts directly under the test/ directory.

What is the best way to test CDS runtime security and data fixtures?

Testing CDS runtime security and data fixtures involves validating access permissions with mock users and loading CSV fixtures. This approach ensures authentication restrictions and persistence logic are verified against real CAP server behavior.

Does cap-test-generator work with TypeScript and @cap-js/cds-test?

Yes, cap-test-generator supports SAP CAP TypeScript projects and utilizes @cap-js/cds-test for service and contract testing. It orchestrates a configurable workflow generating test artifacts for real server interactions and mocked handlers.

How do I mock handlers and business logic for CAP unit tests?

Mocking handlers for CAP unit tests involves isolating business logic through generated mock implementations. This allows targeting specific handler functions without booting the full CDS runtime, ensuring fast and focused execution.

Can I use CSV data fixtures for SAP CAP integration testing?

Yes, you can use CSV data fixtures for SAP CAP integration testing. The generator supports data and integration test modes, validating application behavior with real persistence and structured fixture data loaded into the CDS runtime.