# Testing

> Jest tests, layout, coverage, and how they relate to the TypeScript build Use when this capability is needed.

- Skill: `tomevault-io/testing-58` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/testing-58`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/testing-58/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/testing-58

---


# Testing – Contentstack Webhook Listener

## When to use

- Adding or changing unit/integration tests
- Debugging `npm test` or coverage output

## Instructions

### Runner and config

- **Jest** is configured in **`jest.config.js`**: Node environment, `testRegex: "./test/.*.js$"`, coverage under **`coverage/`** (json + html reporters).
- **`npm test`** runs **`pretest`** → `npm run compile` (runs `tsc`), then **`jest --coverage`**. Ensure **`dist/`** is up to date when tests import compiled code.

### Layout

- Tests live under **`test/unit/`** (e.g. `*.test.js`). **`test/unit/dummy/`** is ignored by Jest (`testPathIgnorePatterns`).

### Style and scope

- Tests are **JavaScript** (`.js`) against the compiled module graph; follow existing files (`index.test.js`, `core.test.js`, `logger.test.js`) for patterns.
- Use **supertest** (devDependency) for HTTP-level assertions where applicable.

### Credentials and secrets

- Do not commit real webhook secrets or Basic Auth credentials; use test doubles or env only as needed in CI-safe ways.

---
> Source: [contentstack/webhook-listener](https://github.com/contentstack/webhook-listener) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

