{"enrichment":{"faq":[{"a":"Testing Strategy recommends structuring Rust unit tests within your backend modules using `#[cfg(test)]` modules and the `#[test]` attribute. For async code, use `#[tokio::test]` to run tests with the Tokio runtime. Keep tests focused on single behaviors, use descriptive names, and leverage assertions like `assert_eq!` and `assert!`. Testing Strategy emphasizes organizing tests close to the code they verify for maintainability.","q":"How do I write Rust unit tests for backend code?"},{"a":"Testing Strategy guides you through React component testing by rendering components with a testing library, then querying and asserting on DOM elements. Use vitest as your test runner for fast feedback. Mock external dependencies and API calls to isolate component logic. For hooks, Testing Strategy recommends using `renderHook` to test custom logic independently, and pair it with `waitFor` for async state updates.","q":"What's the best approach for react component testing with vitest?"},{"a":"Testing Strategy advises creating reusable test fixtures that populate your database with consistent test data before each test run. For SQLite, use in-memory databases to avoid file I/O overhead. Define fixture factories that generate realistic data shapes, then seed them in setup hooks. Testing Strategy emphasizes isolating test data so tests remain independent and can run in any order without side effects.","q":"How should I set up test fixtures and database seeding for integration tests?"},{"a":"Testing Strategy supports the red-green-refactor cycle: write a failing test first, implement minimal code to pass it, then refactor. Track coverage with tools like tarpaulin for Rust and vitest's coverage reports for TypeScript. Testing Strategy recommends setting coverage goals (e.g., 80%) and focusing on critical paths rather than chasing 100%. Regularly review uncovered branches to identify gaps.","q":"How do I implement TDD workflow and improve test coverage?"},{"a":"Testing Strategy explains that Tauri commands can be mocked by stubbing the invoke function in your test environment. Create mock implementations that return predictable responses, allowing you to test frontend logic without running the backend. Testing Strategy suggests using vitest's `vi.mock()` to intercept command calls and inject test data, enabling isolated component testing.","q":"What's the tauri command mocking setup for testing?"},{"a":"Testing Strategy recommends mocking external dependencies using your test framework's mocking utilities. For API calls, intercept HTTP requests with libraries like MSW (Mock Service Worker) or stub fetch/axios directly. Testing Strategy emphasizes testing both success and error paths, validating request payloads, and ensuring your code handles timeouts and network failures gracefully.","q":"How do I test my API calls and external dependencies?"}],"shadow_tags":["backend-testing","frontend-testing","quality-assurance","test-infrastructure","mock-doubles","coverage-metrics","async-testing","end-to-end-workflows","test-data-setup","validation-testing"],"summary_rewrite":"Testing Strategy provides comprehensive testing patterns for Tauri applications spanning Rust backend and React frontend. It covers unit and integration tests, test fixtures, command mocking, and test coverage strategies to support quality assurance and TDD workflows."},"files":[{"bytes":13884,"path":".claude/skills/testing-strategy/SKILL.md","sha256":"1b6f6211cb71eabc9f24934654b398b9342ab577fe7592288de1690d050debe7","url":"https://skillfed.io/files/cacr92/WeReply/testing-strategy/7f3e6c5b/SKILL.md"}],"id":"cacr92/WeReply/testing-strategy","links":{"html":"https://skillfed.io/cacr92/WeReply/testing-strategy","md":"https://skillfed.io/cacr92/WeReply/testing-strategy.md","repo":"https://github.com/cacr92/WeReply"},"meta":{"agents_supported":["claude-code","codex","cursor"],"first_seen":"2026-07-28","forks":3,"language":"Python","last_updated":"2026-01-30","license":"MIT","name":"testing-strategy","publisher":"cacr92","stars":4},"relations":{"similar":[{"id":"cacr92/WeReply/react-typescript-development"},{"id":"xiaolai/vmark/tauri-app-dev"},{"id":"cacr92/WeReply/tdd-workflow"},{"id":"hieutrtr/ai1-skills/react-testing-patterns"},{"id":"stacklok/toolhive-studio/bug-fix-tdd"},{"id":"bobmatnyc/claude-mpm-skills/tanstack-query"},{"id":"bkywksj/knowledge-base/test-development"},{"id":"affaan-m/ECC/react-testing"},{"id":"cacr92/WeReply/error-handling-debugging"},{"id":"tanstack-skills/tanstack-skills/tanstack-query"}]},"slug":{"owner":"cacr92","repo":"WeReply","skill":"testing-strategy"},"version":"7f3e6c5b"}
