Cursor rule
.cursor/rules/testing.mdcJest e2e and TypeScript tests for the CDA SDK
Cursor rules
Quality
81/100
Scores the file, not the repository.Length
187 words
6 headings · 0 code blocksRepository
34
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.123456789# Testing — `contentstack` (CDA)1011## Frameworks1213| Suite | Runner | Notes |14|-------|--------|--------|15| **JS e2e / integration-style** | **Jest** (`jest.js.config.js`) | `testMatch`: `**/test/**/*.js`; ignores `test/index.js`, `test/config.js`, `test/sync_config.js`, some `utils.js` paths |16| **TypeScript** | **Jest** + **ts-jest** (`jest.config.js`) | `npm run test:typescript`; `test/typescript/**/*.test.ts` |1718## Env & live stack1920- **Canonical required vars** for suites that `require('./config')` or `require('../config.js')`: **`HOST`**, **`API_KEY`**, **`DELIVERY_TOKEN`**, **`ENVIRONMENT`** — validated in **`test/config.js`** (loads **dotenv**). Missing any variable throws on import.21- Use a **`.env`** file locally; do not commit secrets. **`HOST`** should match the delivery API host for your stack/region.22- Built SDK: many tests **`require('../../dist/node/contentstack.js')`**. **`npm test`** runs **`pretest`** → **`npm run build`** first.2324## Layout2526- **Suite entry (JS):** `test/index.js` `require`s individual test files.27- **TypeScript:** colocate under **`test/typescript/`** with `*.test.ts` naming.2829## Hygiene3031- No committed **`only`** / **`skip`** for tests that must run in CI.32- Prefer deterministic assertions; mock or scope live tests when adding new cases so CI behavior stays predictable if env is absent.3334## Coverage3536- Jest / reporter config is in **`jest.js.config.js`** and **`jest.config.js`**; HTML reports paths are configured there.37
Also in contentstack/contentstack-javascript
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| contentstack/contentstack-javascript.cursor/rules/code-review.mdc · 34 | Cursor rules | testgitsecuritydependencies+3 | 55/100 | 3 days ago | |
| contentstack/contentstack-javascript.cursor/rules/contentstack-javascript-cda.mdc · 34 | Cursor rules | archdocs | 56/100 | 3 days ago | |
| contentstack/contentstack-javascript.cursor/rules/javascript.mdc · 34 | Cursor rules | testlint-formatstylearch+2 | 74/100 | 3 days ago | |
| contentstack/contentstack-javascriptAGENTS.md · 34 | AGENTS.md | buildtestlint-formatstyle+2 | 79/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
