RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/contentstack/contentstack-javascript

Cursor rule

.cursor/rules/testing.mdc

Jest 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 blocks

Repository

34

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
contentstack/contentstack-javascript/.cursor/rules/testing.mdcRawGitHub
1---
2description: "Jest e2e and TypeScript tests for the CDA SDK"
3globs:
4 - "test/**/*.js"
5 - "test/**/*.ts"
6alwaysApply: false
7---
8 
9# Testing — `contentstack` (CDA)
10 
11## Frameworks
12 
13| 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` |
17 
18## Env & live stack
19 
20- **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.
23 
24## Layout
25 
26- **Suite entry (JS):** `test/index.js` `require`s individual test files.
27- **TypeScript:** colocate under **`test/typescript/`** with `*.test.ts` naming.
28 
29## Hygiene
30 
31- 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.
33 
34## Coverage
35 
36- Jest / reporter config is in **`jest.js.config.js`** and **`jest.config.js`**; HTML reports paths are configured there.
37 

Commands it names

  • jest.js.config.js
  • jest.config.js
  • npm run test:typescript
  • npm test
  • npm run build

Sections

  • Testing — `contentstack` (CDA)
  • Frameworks
  • Env & live stack
  • Layout
  • Hygiene
  • Coverage

What it covers

buildtestcode-stylearchitecturetesting-strategydo-not

Stack — with the evidence

typescript

(1.00)

javascript

(1.00)

jest

(1.00)

eslint

(1.00)

github-actions

(0.60)

node

(0.50)

Glob targeting

  • test/**/*.js
  • test/**/*.ts

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
contentstack
Language
—
License
—
Archived
no

All configs in this repo

Also in contentstack/contentstack-javascript

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
contentstack/contentstack-javascript.cursor/rules/code-review.mdc · 34Cursor rulestypescriptjavascript+3testgitsecuritydependencies+355/1003 days ago
contentstack/contentstack-javascript.cursor/rules/contentstack-javascript-cda.mdc · 34Cursor rulestypescriptjavascript+3archdocs56/1003 days ago
contentstack/contentstack-javascript.cursor/rules/javascript.mdc · 34Cursor rulestypescriptjavascript+3testlint-formatstylearch+274/1003 days ago
contentstack/contentstack-javascriptAGENTS.md · 34AGENTS.mdtypescriptjavascript+4buildtestlint-formatstyle+279/1003 days ago
Diff against .cursor/rules/code-review.mdc Diff against .cursor/rules/contentstack-javascript-cda.mdc Diff against .cursor/rules/javascript.mdc Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack