-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtesting.mdc
More file actions
16 lines (13 loc) · 855 Bytes
/
testing.mdc
File metadata and controls
16 lines (13 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
description: Jest tests and config for contentstack-cli-content-type
globs:
- tests/**/*.ts
- jest.config.js
alwaysApply: false
---
# Testing
- Use **Jest** with **ts-jest** per `jest.config.js`. Tests live under **`tests/`** (and may match `*.test.ts` at repo root per config).
- **Mock HTTP and SDK boundaries** — mock `ContentstackClient`, axios, or fake `managementSDKClient` chains. **No live Contentstack API** calls in unit tests.
- Run **`npm test`**; **`npm run test:coverage`** for coverage against [jest.config.js](jest.config.js) thresholds; **`posttest`** runs ESLint on `.ts` files — keep both green when shipping changes.
- Add or update tests for behavioral changes in `src/core/` and `src/utils/` when practical.
Full detail: `.cursor/skills/testing/SKILL.md`; `references/conventions.md` and `references/jest-mocking.md`.