
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
@cap-js/cds-test
Advanced tools
This is a library with test utilities for CAP Node.js applications, like
chai
-like assertion helpersIn your application project, just install the package as dev dependency:
npm add -D @cap-js/cds-test
Add a simple test file test/bookshop.test.js
with this content:
const cds = require('@sap/cds')
describe('Sample tests', () => {
const { GET, expect } = cds.test (__dirname+'/..')
it('serves Books', async () => {
const { data } = await GET `/odata/v4/catalog/Books`
expect(data.value.length).to.be.greaterThanOrEqual(5)
})
})
Run it with Jest, for example:
npx jest
node --test
and mocha
runners are supported, too, though with less coverage in real-life projects.
See the CAP documentation on cds.test
for more.
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
If you find any bug that may be a security problem, please follow our instructions at in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Copyright 2024-2025 SAP SE or an SAP affiliate company and cds-test contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
[0.3.0] - 2025-04-03
toBeNull
matcher to Jest expectationscds.test.data.reset
is used.FAQs
Test Support for CAP Node.js
The npm package @cap-js/cds-test receives a total of 3,972 weekly downloads. As such, @cap-js/cds-test popularity was classified as popular.
We found that @cap-js/cds-test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.