Cursor rule
.cursor/rules/testing.mdcXCTest patterns, unit vs integration-style tests, fixtures, stability
Cursor rules
Quality
63/100
Scores the file, not the repository.Length
210 words
6 headings · 0 code blocksRepository
3
— · pushed 5 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Testing Rules – Contentstack iOS CDA SDK89Apply when writing or editing tests in the **ContentstackTest** target.1011## Test naming and layout1213- **XCTest** case classes: suffix **`Test`** (e.g. `ContentstackMainTest`, `QueryResultTest`, `SyncTest`) matching existing files under **`ContentstackTest/`**.14- **Test methods:** `- (void)test...` with descriptive names; group related tests with `#pragma mark` sections where the file already uses that style.1516## Unit vs integration-style1718- **Unit-style:** Mock or avoid network where possible; assert parsing, model behavior, and edge cases quickly.19- **Integration-style:** Tests that call the live CDA require valid credentials—typically via **`config.json`** in the test bundle (see `ContentstackMainTest` and similar). Do not commit real tokens; document required keys for local/CI runs.2021## XCTest usage2223- Use **`XCTAssert*`** macros; use **`XCTestExpectation`** / **`waitForExpectationsWithTimeout:`** for async flows.24- Use **`setUp`** / **`tearDown`** for fixtures; load JSON or plist resources from **`[NSBundle bundleForClass:[self class]]`** when the project uses bundle resources.2526## Stability2728- Avoid time-dependent assertions unless necessary; prefer reasonable timeouts for network tests.29- Do not introduce flaky ordering assumptions or shared mutable global state across tests without synchronization.3031## Coverage3233- The **Contentstack** scheme enables code coverage for the **Contentstack** framework target. Add or extend tests when changing production behavior; do not drop coverage for critical paths without replacement tests.34
Also in contentstack/contentstack-ios
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-ios.cursor/rules/code-review.mdc · 3 | Cursor rules | testgitsecuritydependencies+1 | 48/100 | 3 days ago | |
| contentstack/contentstack-ios.cursor/rules/contentstack-ios-cda.mdc · 3 | Cursor rules | styledo-not | 55/100 | 3 days ago | |
| contentstack/contentstack-ios.cursor/rules/ios.mdc · 3 | Cursor rules | stylearchdocs | 52/100 | 3 days ago | |
| contentstack/contentstack-iosAGENTS.md · 3 | AGENTS.md | do-notagent-behaviour | 63/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 | |
| 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 | |
| skillrecordings/egghead-next.cursor/rules/gh-task-plan.mdc · 1.4k | Cursor rules | teststylearchtypes+2 | 96/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-user-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126 | Cursor rules | buildlint-formatstylearch+3 | 96/100 | 3 days ago |
