skills/testing-basics/SKILL.md
Essential testing patterns for any project. Use when: writing tests, setting up testing, or fixing test issues. Triggers: "test", "testing", "unit test", "write tests".
npx skillsauth add timequity/vibe-coder testing-basicsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Core testing patterns that apply to any language or framework.
Arrange → Act → Assert
# Arrange
user = User(name="Alice")
# Act
result = user.greet()
# Assert
assert result == "Hello, Alice!"
| Type | Scope | Speed | When to use | |------|-------|-------|-------------| | Unit | Single function/class | Fast | Core logic | | Integration | Multiple components | Medium | APIs, DB | | E2E | Full system | Slow | Critical paths |
test_[what]_[condition]_[expected]
Examples:
test_login_valid_credentials_returns_tokentest_checkout_empty_cart_raises_errortest_search_no_results_returns_empty_listEach test should:
Mock external dependencies, not internal logic:
# Good: mock external service
@patch('app.services.email.send')
def test_signup_sends_welcome_email(mock_send):
signup(user)
mock_send.assert_called_once()
# Bad: mock internal implementation
@patch('app.models.user.User._validate') # Don't do this
Before committing:
development
Hidden quality gate that runs before showing "Done!" to user - ensures all tests pass, build succeeds, and requirements met before claiming completion
data-ai
Use when about to claim work is complete or fixed - requires running verification commands and confirming output before making any success claims
tools
Generate UI components from natural language descriptions. Use when: user asks for a page, component, or UI element. Triggers: "create page", "add component", "show form", "make button", "страница", "компонент", "форма".
content-media
10 ready-to-use themes with colors and fonts for consistent styling. Use when: applying visual themes to pages, components, or design systems. Triggers: "theme", "color palette", "color scheme", "fonts", "branding", "visual identity", "design system colors".