{"ref":"content:cap-unit-testing-using-mocha-and-chai","page":"/content/cap-unit-testing-using-mocha-and-chai","json":"/content/cap-unit-testing-using-mocha-and-chai.json","generated":"2026-10-27","drafted_with_ai":true,"entity":{"id":"cap-unit-testing-using-mocha-and-chai","title":"CAP: Unit Testing using Mocha and Chai","url":"https://community.sap.com/t5/technology-blog-posts-by-members/cap-unit-testing-using-mocha-and-chai/ba-p/13443454","content_type":"blog","explains":[{"ref":"capability:testing","applies_to":{"ecosystems":["cap"]}}],"summary":"Unit tests added to an existing CAP service rather than written alongside a new one, which is the harder and more common case. Mocha and Chai wired up by hand, from a time before `cds.test` was the obvious answer.","short":"Adding Mocha and Chai unit tests to an existing CAP service","author":"jhodel18","published":"2020-05-31","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/cap-unit-testing-using-mocha-and-chai/ba-p/13443454","title":"CAP: Unit Testing using Mocha and Chai — SAP Community","checked":"2026-09-08"}],"provenance":{"discovered_via":[{"source":"source:sap-community","channel":"cap-tag"}],"first_seen":"2026-09-08"},"drafted_with_ai":true,"published_on":"source:sap-community","history":[{"date":"2026-10-17","field":"explains","from":null,"to":"applies_to on capability:testing (cap)","reason":"Door scope proposed from the title and summary, so a door page lists the piece only where it holds (docs/concepts/content-on-doors.md)."}]},"readings":{"liveness":[{"label":"Checked against the source","tier":"unknown","evidence":"nobody has checked it"},{"label":"Source reachable","tier":"unknown","evidence":"not crawled"},{"label":"Age","tier":"poor","evidence":"published 77 months ago"}],"compatibility":[{"label":"Version","tier":"unknown","evidence":"no version declared"},{"label":"Moved since?","tier":"poor","evidence":"@cap-js/cds-test 0.1.0, 2025-02 and 2 more"},{"label":"Findings","tier":"good","evidence":"none flagged"}],"reach":[{"value":11684,"unit":"views"},{"value":9,"unit":"comments"},{"value":11,"unit":"likes"}]},"signals":{"views":11684,"likes":11,"comments":9,"metrics_at":"2026-10-25"},"series":null,"edges":{"authors":[]}}