[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CDVT4S54EMAPZ231KSP2XQ":3,"skill-same:01M6CDVT4S54EMAPZ231KSP2XQ":91},{"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":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6CDVT4S54EMAPZ231KSP2XQ","generating-unit-tests",null,"Automatically generate comprehensive unit tests from source code covering happy paths, edge cases, and error conditions.\nUse when creating test coverage for functions, classes, or modules.\nTrigger with phrases like \"generate unit tests\", \"create tests for\", or \"add test coverage\".","BbgnsurfTech\u002Fclaude-skills-collection","BbgnsurfTech","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F59598605?v=4","01M6C5ZT4G3G4QPQB64QDVW438","Bbgnsurf Technologies","01M6C5ZT8JN4VWSZZH3DD8J4EG",29,"MIT","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Funit-test-generator\u002Fskills\u002Funit-test-generator\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,37,38,39,40,41],"unit tests","Generating Unit Tests","functions","test","modules","test coverage","use","coverage","edit","write","read","grep","Bash","edge","code","generate","create","add test","2026-11-10 10:12:30",false,"---\nname: generating-unit-tests\nversion: 1.0.0\ndescription: |\n  Automatically generate comprehensive unit tests from source code covering happy paths, edge cases, and error conditions.\n  Use when creating test coverage for functions, classes, or modules.\n  Trigger with phrases like \"generate unit tests\", \"create tests for\", or \"add test coverage\".\nallowed-tools: Read, Write, Edit, Grep, Glob, Bash(test:unit-*)\nlicense: MIT\n---\n## Prerequisites\n\nBefore using this skill, ensure you have:\n- Source code files requiring test coverage\n- Testing framework installed (Jest, Mocha, pytest, JUnit, etc.)\n- Understanding of code dependencies and external services to mock\n- Test directory structure established (e.g., `tests\u002F`, `__tests__\u002F`, `spec\u002F`)\n- Package configuration updated with test scripts\n\n## Instructions\n\n### Step 1: Analyze Source Code\nExamine code structure and identify test requirements:\n1. Use Read tool to load source files from {baseDir}\u002Fsrc\u002F\n2. Identify all functions, classes, and methods requiring tests\n3. Document function signatures, parameters, return types, and side effects\n4. Note external dependencies requiring mocking or stubbing\n\n### Step 2: Determine Testing Framework\nSelect appropriate testing framework based on language:\n- JavaScript\u002FTypeScript: Jest, Mocha, Jasmine, Vitest\n- Python: pytest, unittest, nose2\n- Java: JUnit 5, TestNG\n- Go: testing package with testify assertions\n- Ruby: RSpec, Minitest\n\n### Step 3: Generate Test Cases\nCreate comprehensive test suite covering:\n1. Happy path tests with valid inputs and expected outputs\n2. Edge case tests with boundary values (empty arrays, null, zero, max values)\n3. Error condition tests with invalid inputs\n4. Mock external dependencies (databases, APIs, file systems)\n5. Setup and teardown fixtures for test isolation\n\n### Step 4: Write Test File\nGenerate test file in {baseDir}\u002Ftests\u002F with structure:\n- Import statements for code under test and testing framework\n- Mock declarations for external dependencies\n- Describe\u002Fcontext blocks grouping related tests\n- Individual test cases with arrange-act-assert pattern\n- Cleanup logic in afterEach\u002FtearDown hooks\n\n## Output\n\nThe skill generates complete test files:\n\n### Test File Structure\n```javascript\n\u002F\u002F Example Jest test file\nimport { validator } from '..\u002Fsrc\u002Futils\u002Fvalidator';\n\ndescribe('Validator', () => {\n  describe('validateEmail', () => {\n    it('should accept valid email addresses', () => {\n      expect(validator.validateEmail('test@example.com')).toBe(true);\n    });\n\n    it('should reject invalid email formats', () => {\n      expect(validator.validateEmail('invalid-email')).toBe(false);\n    });\n\n    it('should handle null and undefined', () => {\n      expect(validator.validateEmail(null)).toBe(false);\n      expect(validator.validateEmail(undefined)).toBe(false);\n    });\n  });\n});\n```\n\n### Coverage Metrics\n- Line coverage percentage (target: 80%+)\n- Branch coverage showing tested conditional paths\n- Function coverage ensuring all exports are tested\n- Statement coverage for comprehensive validation\n\n### Mock Implementations\nGenerated mocks for:\n- Database connections and queries\n- HTTP requests to external APIs\n- File system operations (read\u002Fwrite)\n- Environment variables and configuration\n- Time-dependent functions (Date.now(), setTimeout)\n\n## Error Handling\n\nCommon issues and solutions:\n\n**Module Import Errors**\n- Error: Cannot find module or dependencies\n- Solution: Install missing packages; verify import paths match project structure; check TypeScript configuration\n\n**Mock Setup Failures**\n- Error: Mock not properly intercepting calls\n- Solution: Ensure mocks are defined before imports; use proper mocking syntax for framework; clear mocks between tests\n\n**Async Test Timeouts**\n- Error: Test exceeded timeout before completing\n- Solution: Increase timeout for slow operations; ensure async\u002Fawait or done callbacks are used correctly; check for unresolved promises\n\n**Test Isolation Issues**\n- Error: Tests pass individually but fail when run together\n- Solution: Add proper cleanup in afterEach hooks; avoid shared mutable state; reset mocks between tests\n\n## Resources\n\n### Testing Frameworks\n- Jest documentation for JavaScript testing\n- pytest documentation for Python testing\n- JUnit 5 User Guide for Java testing\n- Go testing package and testify library\n\n### Best Practices\n- Follow AAA pattern (Arrange, Act, Assert) for test structure\n- Write tests before fixing bugs (test-driven bug fixing)\n- Use descriptive test names that explain the scenario\n- Keep tests independent and avoid test interdependencies\n- Mock external dependencies for unit test isolation\n- Aim for 80%+ code coverage on critical paths","## Prerequisites\n\nBefore using this skill, ensure you have:\n- Source code files requiring test coverage\n- Testing framework installed (Jest, Mocha, pytest, JUnit, etc.)\n- Understanding of code dependencies and external services to mock\n- Test directory structure established (e.g., `tests\u002F`, `__tests__\u002F`, `spec\u002F`)\n- Package configuration updated with test scripts\n\n## Instructions\n\n### Step 1: Analyze Source Code\nExamine code structure and identify test requirements:\n1. Use Read tool to load source files from {baseDir}\u002Fsrc\u002F\n2. Identify all functions, classes, and methods requiring tests\n3. Document function signatures, parameters, return types, and side effects\n4. Note external dependencies requiring mocking or stubbing\n\n### Step 2: Determine Testing Framework\nSelect appropriate testing framework based on language:\n- JavaScript\u002FTypeScript: Jest, Mocha, Jasmine, Vitest\n- Python: pytest, unittest, nose2\n- Java: JUnit 5, TestNG\n- Go: testing package with testify assertions\n- Ruby: RSpec, Minitest\n\n### Step 3: Generate Test Cases\nCreate comprehensive test suite covering:\n1. Happy path tests with valid inputs and expected outputs\n2. Edge case tests with boundary values (empty arrays, null, zero, max values)\n3. Error condition tests with invalid inputs\n4. Mock external dependencies (databases, APIs, file systems)\n5. Setup and teardown fixtures for test isolation\n\n### Step 4: Write Test File\nGenerate test file in {baseDir}\u002Ftests\u002F with structure:\n- Import statements for code under test and testing framework\n- Mock declarations for external dependencies\n- Describe\u002Fcontext blocks grouping related tests\n- Individual test cases with arrange-act-assert pattern\n- Cleanup logic in afterEach\u002FtearDown hooks\n\n## Output\n\nThe skill generates complete test files:\n\n### Test File Structure\n```javascript\n\u002F\u002F Example Jest test file\nimport { validator } from '..\u002Fsrc\u002Futils\u002Fvalidator';\n\ndescribe('Validator', () => {\n  describe('validateEmail', () => {\n    it('should accept valid email addresses', () => {\n      expect(validator.validateEmail('test@example.com')).toBe(true);\n    });\n\n    it('should reject invalid email formats', () => {\n      expect(validator.validateEmail('invalid-email')).toBe(false);\n    });\n\n    it('should handle null and undefined', () => {\n      expect(validator.validateEmail(null)).toBe(false);\n      expect(validator.validateEmail(undefined)).toBe(false);\n    });\n  });\n});\n```\n\n### Coverage Metrics\n- Line coverage percentage (target: 80%+)\n- Branch coverage showing tested conditional paths\n- Function coverage ensuring all exports are tested\n- Statement coverage for comprehensive validation\n\n### Mock Implementations\nGenerated mocks for:\n- Database connections and queries\n- HTTP requests to external APIs\n- File system operations (read\u002Fwrite)\n- Environment variables and configuration\n- Time-dependent functions (Date.now(), setTimeout)\n\n## Error Handling\n\nCommon issues and solutions:\n\n**Module Import Errors**\n- Error: Cannot find module or dependencies\n- Solution: Install missing packages; verify import paths match project structure; check TypeScript configuration\n\n**Mock Setup Failures**\n- Error: Mock not properly intercepting calls\n- Solution: Ensure mocks are defined before imports; use proper mocking syntax for framework; clear mocks between tests\n\n**Async Test Timeouts**\n- Error: Test exceeded timeout before completing\n- Solution: Increase timeout for slow operations; ensure async\u002Fawait or done callbacks are used correctly; check for unresolved promises\n\n**Test Isolation Issues**\n- Error: Tests pass individually but fail when run together\n- Solution: Add proper cleanup in afterEach hooks; avoid shared mutable state; reset mocks between tests\n\n## Resources\n\n### Testing Frameworks\n- Jest documentation for JavaScript testing\n- pytest documentation for Python testing\n- JUnit 5 User Guide for Java testing\n- Go testing package and testify library\n\n### Best Practices\n- Follow AAA pattern (Arrange, Act, Assert) for test structure\n- Write tests before fixing bugs (test-driven bug fixing)\n- Use descriptive test names that explain the scenario\n- Keep tests independent and avoid test interdependencies\n- Mock external dependencies for unit test isolation\n- Aim for 80%+ code coverage on critical paths",{"name":5,"license":15,"version":47,"description":48,"allowed-tools":49},"1.0.0","Automatically generate comprehensive unit tests from source code covering happy paths, edge cases, and error conditions.\nUse when creating test coverage for functions, classes, or modules.\nTrigger with phrases like \"generate unit tests\", \"create tests for\", or \"add test coverage\".\n","Read, Write, Edit, Grep, Glob, Bash(test:unit-*)","main","01d3fafeca1133f841956b8b90b939fee92d71e7","plugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Funit-test-generator\u002Fskills\u002Funit-test-generator",9,"https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech","www.bbgnsurf.com","An ICT solutions provider and software development company","2025-12-18 20:19:58",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add BbgnsurfTech\u002Fclaude-skills-collection --skill generating-unit-tests",{"tool":65,"command":66},"bunx","bunx skills add BbgnsurfTech\u002Fclaude-skills-collection --skill generating-unit-tests",{"tool":68,"command":69},"pnpm","pnpm dlx skills add BbgnsurfTech\u002Fclaude-skills-collection --skill generating-unit-tests","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Funit-test-generator\u002Fskills\u002Funit-test-generator\u002FSKILL.md",true,[73,79,85],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"assets\u002FREADME.md","ASSET","资产文件",223,"https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Funit-test-generator\u002Fskills\u002Funit-test-generator\u002Fassets\u002FREADME.md",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002FREADME.md","REFERENCE","参考文档",331,"https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Funit-test-generator\u002Fskills\u002Funit-test-generator\u002Freferences\u002FREADME.md",{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002FREADME.md","SCRIPT","脚本",271,"https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Funit-test-generator\u002Fskills\u002Funit-test-generator\u002Fscripts\u002FREADME.md",[92,107,128,141,155,165],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":99,"publishedAt":42},"01M6CDVX5RHG36WP2Z7X8WAYYA","testing-visual-regression","Detect visual changes in UI components using screenshot comparison.\nUse when detecting unintended UI changes or pixel differences.\nTrigger with phrases like \"test visual changes\", \"compare screenshots\", or \"detect UI regressions\".","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Fvisual-regression-tester\u002Fskills\u002Fvisual-regression-tester\u002FSKILL.md",[98],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[100,101,102,27,30,32,33,34,35,36,103,104,105,106],"testing visual regression","testing","regression","ui","screenshot","components","screenshots",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":119,"publishedAt":42},"01M6CDVPQKGQ450Q50ZC84FPMR","generating-test-reports","Generate comprehensive test reports with metrics, coverage, and visualizations.\nUse when performing specialized testing.\nTrigger with phrases like \"generate test report\", \"create test documentation\", or \"show test metrics\".","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Ftest-report-generator\u002Fskills\u002Ftest-report-generator\u002FSKILL.md",[113,114],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[120,27,121,122,36,123,124,39,40,125,101,35,126,30,31,32,33,34,127],"reports","Generating Test Reports","visualizations","metrics","report","documentation","test report","specialized",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":135,"publishedAt":42},"01M6CDVK97VFZ53CEYEGQ4QFZ6","orchestrating-test-execution","Coordinate parallel test execution across multiple environments and frameworks.\nUse when performing specialized testing.\nTrigger with phrases like \"orchestrate tests\", \"run parallel tests\", or \"coordinate test execution\".","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Ftest-orchestrator\u002Fskills\u002Ftest-orchestrator\u002FSKILL.md",[134],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[136,27,137,34,127,138,30,33,32,139,36,140,101,35],"orchestrating test execution","execution","run","parallel","orchestrate",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":148,"publishedAt":42},"01M6CDVFTCBQ65TGB1YJCZB90G","managing-test-environments","Provision and manage isolated test environments with configuration and data.\nUse when performing specialized testing.\nTrigger with phrases like \"manage test environment\", \"provision test env\", or \"setup test infrastructure\".","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Ftest-environment-manager\u002Fskills\u002Ftest-environment-manager\u002FSKILL.md",[147],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[27,149,34,150,30,151,32,33,127,35,36,152,153,154,101],"Managing Test Environments","manage","environment","data","infrastructure","setup",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":162,"publishedAt":42},"01M6CDVD0NPFXVEQGT9CMF02H0","generating-test-doubles","Generate mocks, stubs, spies, and fakes for dependency isolation.\nUse when creating mocks, stubs, or test isolation fixtures.\nTrigger with phrases like \"generate mocks\", \"create test doubles\", or \"setup stubs\".","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Ftest-doubles-generator\u002Fskills\u002Ftest-doubles-generator\u002FSKILL.md",[161],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[163,27,33,34,35,36,39,40,154,32,164,30],"Generating Test Doubles","dependency",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":175,"publishedAt":42},"01M6CDVA70G5NVGB6KGF9ZNXDZ","generating-test-data","Generate realistic test data including edge cases and boundary conditions.\nUse when creating realistic fixtures or edge case test data.\nTrigger with phrases like \"generate test data\", \"create fixtures\", or \"setup test database\".","https:\u002F\u002Fgithub.com\u002FBbgnsurfTech\u002Fclaude-skills-collection\u002Fblob\u002Fmain\u002Fplugins\u002Fclaude-code-plugins-plus\u002Fplugins\u002Ftesting\u002Ftest-data-generator\u002Fskills\u002Ftest-data-generator\u002FSKILL.md",[171,172],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":173,"categoryName":174,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000033","数据分析师",[176,27,152,33,30,32,34,35,36,177,37,178,39,40,154],"Generating Test Data","boundary","database"]