testing

द्वारा contentstack

XCTest—लेआउट, मॉक्स, फिक्स्चर, SwiftLint/Slather, ऑफलाइन टेस्ट, लिनक्स मैनिफेस्ट।

npx skills add https://github.com/contentstack/contentstack-utils-swift --skill testing

Testing – Contentstack Utils Swift

When to use

  • Adding or changing tests under Tests/ContentstackUtilsTests/.
  • Debugging flaky tests; improving fixtures or mocks.

Runner and tooling

  • XCTest via swift test (SPM) and/or Xcode scheme ContentstackUtils-Package (ContentstackUtils.xcodeproj), matching .github/workflows/ci.yml.
  • SwiftLint: .swiftlint.yml; Tests/ContentstackUtilsTests/Constants.swift is excluded—other test files are linted.
  • Slather: .slather.yml ignores Tests/* in coverage reports; still add tests for new production code in Sources/ContentstackUtils/ when practical.

Test naming and layout

  • Target: ContentstackUtilsTests; path Tests/ContentstackUtilsTests/.
  • File names: *Tests.swift, *Test.swift, or feature-oriented names (GQLJsonToHtml.swift, JsonNodes.swift, VariantUtilityTests.swift).
  • Fixtures and mocks: Prefer JsonNodes.swift, JsonNodesHtmlResults.swift, EmbededModelMock.swift, CustomRenderOptionMock.swift, TestClient.swift, etc., before adding parallel helpers.

Integration vs unit

  • No separate integration tree: tests live in ContentstackUtilsTests with mocks for API-shaped payloads—no live network or credentials in CI.

Linux / discovery

  • Maintain XCTestManifests.swift if your workflow requires explicit Linux test discovery.

Secrets

  • Tests are offline; do not commit API keys or real tokens.

References

  • skills/dev-workflow/SKILL.md
  • skills/code-review/SKILL.md

contentstack की और Skills

cms-assets
contentstack
डेवलपर्स को Contentstack में एसेट्स को व्यवस्थित करने, वितरित करने और बदलने के बारे में सलाह दें। फोल्डर संरचना, Image Delivery API ट्रांसफॉर्मेशन, प्रकाशन कवर करें...
cms-branches-aliases
contentstack
डेवलपर्स को Contentstack branches का उपयोग करके पृथक सामग्री विकास और aliases के लिए शून्य-डाउनटाइम सामग्री परिनियोजन पर सलाह दें। Branch रणनीति को कवर करें,…
cms-data-modeling-best-practices
contentstack
डेवलपर्स को Contentstack में कंटेंट मॉडल करने के लिए सबसे सरल पुन: प्रयोज्य संरचना का उपयोग करने का मार्गदर्शन करें। यह स्किल बताती है कि कंटेंट टाइप, रेफरेंस, ग्लोबल… का उपयोग कब करना चाहिए।
cms-live-preview-visual-builder-support-assistant
contentstack
Contentstack Live Preview और Visual Builder कार्यान्वयनों का निदान और मार्गदर्शन करें। पूर्वावलोकन संदर्भ का पता लगाएं, टूटे हुए अनुबंध की पहचान करें, और अनुशंसा करें…
cms-releases
contentstack
डेवलपर्स को समन्वित, परमाणु सामग्री परिनियोजन के लिए Contentstack Releases का उपयोग करने पर सलाह दें। रिलीज़ निर्माण, आइटम प्रबंधन, चरणबद्ध परिनियोजन को शामिल करें,…
cms-roles-permissions
contentstack
डेवलपर्स को Contentstack में भूमिकाओं, अनुमतियों, टीमों और टोकन एक्सेस डिज़ाइन करने पर सलाह दें। बिल्ट-इन भूमिकाओं, कस्टम भूमिकाओं, अनुमति विलय,… की व्याख्या करें।
cms-taxonomy
contentstack
डेवलपर्स को संरचित, श्रेणीबद्ध सामग्री वर्गीकरण और डिलीवरी-पक्ष फ़िल्टरिंग के लिए Contentstack Taxonomy का उपयोग करने पर सलाह दें। Taxonomy बनाम tags को कवर करता है,…
cms-tokens-authentication
contentstack
डेवलपर्स को फ्रंटएंड, बैकएंड, ऑटोमेशन और थर्ड-पार्टी ऐप उपयोग के मामलों के लिए सही Contentstack प्रमाणीकरण विधि और टोकन प्रकार चुनने पर सलाह दें।…