CapabilityDeveloper ExperienceNode.js, read from its artifacts

Testing

Proving the service still does what it did — against the model and the handlers, without a deployed system and without a database somebody has to keep clean.

Showing artifacts, examples and content with confirmed Node.js applicability. View All CAP

Overview

SAP SHIPS
@cap-js/cds-test

cds.test() launches the CAP project under test and returns helpers bound to it, the GET, POST and PUT shortcuts against its URL and port and the expect() assertions, so a test asserts against a running service rather than against a deployed one. Added as a dev dependency; capire names Vitest, Jest, Mocha and Node's own runner as the runners it runs under.

SourceTesting with cds.test — capirechecked

A Node.js coverage assessment has not been written. View all flavors

THE COMMUNITY ADDS

A Node.js coverage assessment has not been written. View all flavors

Artifacts5

5 of 5 artifacts
ArtifactSignals
CDS plugins2
cds-cucumberGherkin scenarios driving a running CAP service
Signals
none
cds-launchpad-pluginSandbox launchpad for all SAPUI5 apps in a CAP workspace
Signals
none
CLI tools2
sapbrunoTerminal UI running Bruno collections against a CAP service
Signals
none
enforce-export-coverageGeneralStatic check that each exported TypeScript function has a test
Signals
Functional boundary
Packages1
@cap-js/cds-testTest support for CAP Node.js: server start, HTTP client, assertions
Signals
none

Content1

Group by
Piece, what it offers
CAP full-stack testing with BDD flavour
SAP Community, Vladislav Leonkev, Blog
CAP full-stack testing with BDD flavour
SAP Community, Vladislav Leonkev, Blog

Details

What changed — and what it makes stale1
@sap/cds 9.0.2, CAP, Node.js

@cap-js/cds-test stopped being optional: cds.test now refuses to run unless the package is installed, and the axios, chai, chai-as-promised and chai-subset dependencies a project used to add by hand are no longer needed once it is. The 9.0 line reached npm as 9.0.2 on 2025-06-02 — 9.0.0 and 9.0.1 were never published.

Makes stale:

Setup steps that install axios, chai, chai-as-promised and chai-subset directly to use cds.test rather than adding @cap-js/cds-test. On cds9, cds.test does not run without the latter present, regardless of what else is installed.

SourceCAP changelog 2025 — cds@9.0.0checked
Coverage
statecore and community, CAP, Node.js, derived
For your agent