craft-coder/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/plugins 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:
tools
Backup strategies, disaster recovery planning, and business continuity.
devops
Cloud cost management, rightsizing, and FinOps practices.
testing
CI/CD pipeline design with GitHub Actions, GitLab CI, and best practices.
development
Validate idea and create detailed PRD. Saves docs/PRD.md to project. Use when: user describes an app idea, wants to create something new. Triggers: "I want to build", "create app", "make website", "build MVP", "хочу создать", "сделать приложение".