[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QPBJGZF3AE7GCYEGQ0A0HW":3,"skill-same:01M6QPBJGZF3AE7GCYEGQ0A0HW":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":14,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M6QPBJGZF3AE7GCYEGQ0A0HW","testing-patterns",null,"Testing patterns and principles. Unit, integration, mocking strategies.","LOrdEnRYQuE\u002FLRDEnE-Ai-Specialist","LOrdEnRYQuE","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93767164?v=4","01M6QNZGVYDMQTN925B3BDB98Z","LOrdEnRYQuE | Advanced Digital Solutions ","01M6QNZH078JB4S8QJNNQNJPS5",0,"MIT","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Ftesting-patterns\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36],"testing","testing patterns","patterns","integration","Bash","grep","read","write","edit","strategies","unit","mocking","principles","2026-11-10 10:12:30",false,"---\nname: testing-patterns\ndescription: Testing patterns and principles. Unit, integration, mocking strategies.\nallowed-tools: Read, Write, Edit, Glob, Grep, Bash\n---\n\n# Testing Patterns\n\n> Principles for reliable test suites.\n\n---\n\n## 1. Testing Pyramid\n\n```\n        \u002F\\          E2E (Few)\n       \u002F  \\         Critical flows\n      \u002F----\\\n     \u002F      \\       Integration (Some)\n    \u002F--------\\      API, DB queries\n   \u002F          \\\n  \u002F------------\\    Unit (Many)\n                    Functions, classes\n```\n\n---\n\n## 2. AAA Pattern\n\n| Step | Purpose |\n|------|---------|\n| **Arrange** | Set up test data |\n| **Act** | Execute code under test |\n| **Assert** | Verify outcome |\n\n---\n\n## 3. Test Type Selection\n\n### When to Use Each\n\n| Type | Best For | Speed |\n|------|----------|-------|\n| **Unit** | Pure functions, logic | Fast (\u003C50ms) |\n| **Integration** | API, DB, services | Medium |\n| **E2E** | Critical user flows | Slow |\n\n---\n\n## 4. Unit Test Principles\n\n### Good Unit Tests\n\n| Principle | Meaning |\n|-----------|---------|\n| Fast | \u003C 100ms each |\n| Isolated | No external deps |\n| Repeatable | Same result always |\n| Self-checking | No manual verification |\n| Timely | Written with code |\n\n### What to Unit Test\n\n| Test | Don't Test |\n|------|------------|\n| Business logic | Framework code |\n| Edge cases | Third-party libs |\n| Error handling | Simple getters |\n\n---\n\n## 5. Integration Test Principles\n\n### What to Test\n\n| Area | Focus |\n|------|-------|\n| API endpoints | Request\u002Fresponse |\n| Database | Queries, transactions |\n| External services | Contracts |\n\n### Setup\u002FTeardown\n\n| Phase | Action |\n|-------|--------|\n| Before All | Connect resources |\n| Before Each | Reset state |\n| After Each | Clean up |\n| After All | Disconnect |\n\n---\n\n## 6. Mocking Principles\n\n### When to Mock\n\n| Mock | Don't Mock |\n|------|------------|\n| External APIs | The code under test |\n| Database (unit) | Simple dependencies |\n| Time\u002Frandom | Pure functions |\n| Network | In-memory stores |\n\n### Mock Types\n\n| Type | Use |\n|------|-----|\n| Stub | Return fixed values |\n| Spy | Track calls |\n| Mock | Set expectations |\n| Fake | Simplified implementation |\n\n---\n\n## 7. Test Organization\n\n### Naming\n\n| Pattern | Example |\n|---------|---------|\n| Should behavior | \"should return error when...\" |\n| When condition | \"when user not found...\" |\n| Given-when-then | \"given X, when Y, then Z\" |\n\n### Grouping\n\n| Level | Use |\n|-------|-----|\n| describe | Group related tests |\n| it\u002Ftest | Individual case |\n| beforeEach | Common setup |\n\n---\n\n## 8. Test Data\n\n### Strategies\n\n| Approach | Use |\n|----------|-----|\n| Factories | Generate test data |\n| Fixtures | Predefined datasets |\n| Builders | Fluent object creation |\n\n### Principles\n\n- Use realistic data\n- Randomize non-essential values (faker)\n- Share common fixtures\n- Keep data minimal\n\n---\n\n## 9. Best Practices\n\n| Practice | Why |\n|----------|-----|\n| One assert per test | Clear failure reason |\n| Independent tests | No order dependency |\n| Fast tests | Run frequently |\n| Descriptive names | Self-documenting |\n| Clean up | Avoid side effects |\n\n---\n\n## 10. Anti-Patterns\n\n| ❌ Don't | ✅ Do |\n|----------|-------|\n| Test implementation | Test behavior |\n| Duplicate test code | Use factories |\n| Complex test setup | Simplify or split |\n| Ignore flaky tests | Fix root cause |\n| Skip cleanup | Reset state |\n\n---\n\n> **Remember:** Tests are documentation. If someone can't understand what the code does from the tests, rewrite them.\n","# Testing Patterns\n\n> Principles for reliable test suites.\n\n---\n\n## 1. Testing Pyramid\n\n```\n        \u002F\\          E2E (Few)\n       \u002F  \\         Critical flows\n      \u002F----\\\n     \u002F      \\       Integration (Some)\n    \u002F--------\\      API, DB queries\n   \u002F          \\\n  \u002F------------\\    Unit (Many)\n                    Functions, classes\n```\n\n---\n\n## 2. AAA Pattern\n\n| Step | Purpose |\n|------|---------|\n| **Arrange** | Set up test data |\n| **Act** | Execute code under test |\n| **Assert** | Verify outcome |\n\n---\n\n## 3. Test Type Selection\n\n### When to Use Each\n\n| Type | Best For | Speed |\n|------|----------|-------|\n| **Unit** | Pure functions, logic | Fast (\u003C50ms) |\n| **Integration** | API, DB, services | Medium |\n| **E2E** | Critical user flows | Slow |\n\n---\n\n## 4. Unit Test Principles\n\n### Good Unit Tests\n\n| Principle | Meaning |\n|-----------|---------|\n| Fast | \u003C 100ms each |\n| Isolated | No external deps |\n| Repeatable | Same result always |\n| Self-checking | No manual verification |\n| Timely | Written with code |\n\n### What to Unit Test\n\n| Test | Don't Test |\n|------|------------|\n| Business logic | Framework code |\n| Edge cases | Third-party libs |\n| Error handling | Simple getters |\n\n---\n\n## 5. Integration Test Principles\n\n### What to Test\n\n| Area | Focus |\n|------|-------|\n| API endpoints | Request\u002Fresponse |\n| Database | Queries, transactions |\n| External services | Contracts |\n\n### Setup\u002FTeardown\n\n| Phase | Action |\n|-------|--------|\n| Before All | Connect resources |\n| Before Each | Reset state |\n| After Each | Clean up |\n| After All | Disconnect |\n\n---\n\n## 6. Mocking Principles\n\n### When to Mock\n\n| Mock | Don't Mock |\n|------|------------|\n| External APIs | The code under test |\n| Database (unit) | Simple dependencies |\n| Time\u002Frandom | Pure functions |\n| Network | In-memory stores |\n\n### Mock Types\n\n| Type | Use |\n|------|-----|\n| Stub | Return fixed values |\n| Spy | Track calls |\n| Mock | Set expectations |\n| Fake | Simplified implementation |\n\n---\n\n## 7. Test Organization\n\n### Naming\n\n| Pattern | Example |\n|---------|---------|\n| Should behavior | \"should return error when...\" |\n| When condition | \"when user not found...\" |\n| Given-when-then | \"given X, when Y, then Z\" |\n\n### Grouping\n\n| Level | Use |\n|-------|-----|\n| describe | Group related tests |\n| it\u002Ftest | Individual case |\n| beforeEach | Common setup |\n\n---\n\n## 8. Test Data\n\n### Strategies\n\n| Approach | Use |\n|----------|-----|\n| Factories | Generate test data |\n| Fixtures | Predefined datasets |\n| Builders | Fluent object creation |\n\n### Principles\n\n- Use realistic data\n- Randomize non-essential values (faker)\n- Share common fixtures\n- Keep data minimal\n\n---\n\n## 9. Best Practices\n\n| Practice | Why |\n|----------|-----|\n| One assert per test | Clear failure reason |\n| Independent tests | No order dependency |\n| Fast tests | Run frequently |\n| Descriptive names | Self-documenting |\n| Clean up | Avoid side effects |\n\n---\n\n## 10. Anti-Patterns\n\n| ❌ Don't | ✅ Do |\n|----------|-------|\n| Test implementation | Test behavior |\n| Duplicate test code | Use factories |\n| Complex test setup | Simplify or split |\n| Ignore flaky tests | Fix root cause |\n| Skip cleanup | Reset state |\n\n---\n\n> **Remember:** Tests are documentation. If someone can't understand what the code does from the tests, rewrite them.\n",{"name":5,"description":7,"allowed-tools":42},"Read, Write, Edit, Glob, Grep, Bash","main","b04f8c98dcf3dfacf4e2aff1eae92616ed12d83d",".agent\u002Fskills\u002Ftesting-patterns","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE","2026-04-10 19:41:10",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add LOrdEnRYQuE\u002FLRDEnE-Ai-Specialist --skill testing-patterns",{"tool":55,"command":56},"bunx","bunx skills add LOrdEnRYQuE\u002FLRDEnE-Ai-Specialist --skill testing-patterns",{"tool":58,"command":59},"pnpm","pnpm dlx skills add LOrdEnRYQuE\u002FLRDEnE-Ai-Specialist --skill testing-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Ftesting-patterns\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"scripts\u002Ftest_runner.py","SCRIPT","脚本",7078,"https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Ftesting-patterns\u002Fscripts\u002Ftest_runner.py",[70,97,130,158,164,173],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":37},"01M6QPEC0HA7GF9HY9S3YDF256","WebApp Architect","Plan, build, refactor, debug, and prepare web applications end-to-end. Activate for greenfield builds, feature additions, architecture reviews, and deployment prep.","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002Fadapters\u002Fwindsurf\u002F.agents\u002Fskills\u002Fwebapp-architect\u002FSKILL.md",[],[77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96],"webapp architect","webapp","architect","web","architecture","prepare","debug","deployment","refactor","applications","plan","repo","build","activate","scan","feature","end","reviews","prep","for",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":111,"publishedAt":37},"01M6QPE68RNE5PWPC2CPK7ZHCZ","SEO Growth Auditor","Perform technical and on-page SEO audits, generate schema markup, and produce prioritized action reports. Activate for site launches, ranking improvements, and metadata fixes.","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002Fadapters\u002Fwindsurf\u002F.agents\u002Fskills\u002Fseo-auditor\u002FSKILL.md",[103,106],{"categoryNo":104,"categoryName":105,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000019","营销推广",{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000035","市场营销","PROFESSION","适用职业",[112,113,114,115,96,116,117,118,119,120,121,122,123,124,125,126,127,128,129,90],"seo","seo growth auditor","auditor","growth","fixes","action","reports","ranking","crawl","generate","produce","metadata","audit","schema markup","site","page","technical","schema",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":139,"publishedAt":37},"01M6QPDSN4KMHFS4CTEMN3520Q","GDPR Compliance Copilot","Identify GDPR compliance gaps, map data flows, generate DSAR templates, and prepare privacy policy inputs. Always requires human legal review.","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002Fadapters\u002Fwindsurf\u002F.agents\u002Fskills\u002Fgdpr-copilot\u002FSKILL.md",[136],{"categoryNo":137,"categoryName":138,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000037","律师与法务",[132,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,121],"gdpr compliance","gdpr","compliance","copilot","legal review","report","policy","privacy","flow","templates","dsar","map","human","gap","review","flows","privacy policy","gaps",{"skillNo":159,"name":160,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":37},"01M6QPDR5FMXB4X0960JKCMK80","webapp-architect","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002Fadapters\u002Fcursor\u002Fskills\u002Fwebapp-architect\u002FSKILL.md",[],[77,78,79],{"skillNo":165,"name":166,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":171,"publishedAt":37},"01M6QPDM6FZDXXQS2KRJT1YD8P","seo-auditor","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002Fadapters\u002Fcursor\u002Fskills\u002Fseo-auditor\u002FSKILL.md",[169,170],{"categoryNo":104,"categoryName":105,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},[112,172,114],"seo auditor",{"skillNo":174,"name":175,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":178,"publishedAt":37},"01M6QPDGEH5RE1VEY57YZ1GA1Q","gdpr-copilot","https:\u002F\u002Fgithub.com\u002FLOrdEnRYQuE\u002FLRDEnE-Ai-Specialist\u002Fblob\u002Fmain\u002Fadapters\u002Fcursor\u002Fskills\u002Fgdpr-copilot\u002FSKILL.md",[],[143,141,179],"gdpr copilot"]