ios-viewmodel-test-generator

Generate XCTest unit tests for iOS ViewModels with Given-When-Then patterns.

222|4|Updated Dec 19, 2019
One-click install
npx skills add https://github.com/3dollar-in-my-pocket/3dollars-in-my-pocket-ios --skill ios-viewmodel-test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ios-viewmodel-test-generator
Source: https://github.com/3dollar-in-my-pocket/3dollars-in-my-pocket-ios/tree/main/.claude/skills/ios-viewmodel-test-generator
Command: npx skills add https://github.com/3dollar-in-my-pocket/3dollars-in-my-pocket-ios --skill ios-viewmodel-test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of XCTest test cases for iOS ViewModels, significantly reducing the manual effort required for writing unit tests and ensuring comprehensive test coverage.

Core Features & Use Cases

  • Automated Test Generation: Creates Given-When-Then style test cases for ViewModels based on user flows.
  • XCTest & Combine Integration: Leverages standard iOS testing frameworks and Combine for reactive programming.
  • Mocking: Includes patterns for creating mock repositories to isolate ViewModel logic.
  • Use Case: Quickly generate tests for a new ViewModel, ensuring its inputs correctly map to outputs and that navigation logic functions as expected, all following established patterns.

Quick Start

Use the ios-viewmodel-test-generator skill to create a test file for the UserProfileViewModel.

Frequently Asked Questions about ios-viewmodel-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate XCTest unit tests for an iOS ViewModel?

You can generate XCTest unit tests for an iOS ViewModel by using an automated skill that creates Given-When-Then style test cases, handling assertion logic and routing scenarios to ensure comprehensive test coverage with minimal manual effort.

Does iOS ViewModel test generation work with Combine and async/await?

Yes, iOS ViewModel test generation works with Combine and async/await by leveraging standard iOS testing frameworks to validate reactive inputs and outputs, ensuring the generated test suites remain maintainable and robust.

What is the best way to automate mock repository creation for iOS ViewModel tests?

The best way to automate mock repository creation is to use a test generation skill that automatically isolates ViewModel logic by including established mocking patterns directly within the generated XCTest files.

Can I validate ViewModel navigation routing logic in XCTest?

Yes, you can validate ViewModel navigation routing logic in XCTest by generating specific test cases that assert routing scenarios, verifying that user flows trigger the expected outputs and navigation paths.

Do I need to manually write Given-When-Then structures for iOS testing?

No, you do not need to manually write Given-When-Then structures for iOS testing because the generation skill automates the creation of these test cases based on user flows, adhering to established testing best practices.