[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBM3XS82Z904KT01341AFJ":3,"skill-same:01M6EBM3XS82Z904KT01341AFJ":67},{"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":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6EBM3XS82Z904KT01341AFJ","nestjs-testing",null,"Unit and E2E testing with Jest, mocking strategies, and database isolation. Use when writing NestJS unit tests, E2E tests with supertest, or mock providers. (triggers: **\u002F*.spec.ts, test\u002F**\u002F*.e2e-spec.ts, Test.createTestingModule, supertest, jest, beforeEach)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-testing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"nestjs testing","nestjs","testing","use","unit","mock","isolation","triggers","tests","strategies","jest","e2e","Providers","database","e2e tests","unit tests","test","e2e testing","spec","writing","2026-11-10 10:12:30",false,"---\nname: nestjs-testing\ndescription: \"Unit and E2E testing with Jest, mocking strategies, and database isolation. Use when writing NestJS unit tests, E2E tests with supertest, or mock providers. (triggers: **\u002F*.spec.ts, test\u002F**\u002F*.e2e-spec.ts, Test.createTestingModule, supertest, jest, beforeEach)\"\n---\n\n# NestJS Testing\n\n## **Priority: P2 (MAINTENANCE)**\n\n## Structure\n\n```\nsrc\u002F**\u002F*.spec.ts      # Unit tests (isolated logic)\ntest\u002F**\u002F*.e2e-spec.ts # E2E tests (full app flows)\n```\n\n## Unit Testing\n\n- **Setup**: Use `Test.createTestingModule()` with mocked providers\n- **Mocks**: Mock all dependencies via `{ provide: X, useValue: mockX }`\n- **Pattern**: AAA (Arrange-Act-Assert)\n- **Cleanup**: Call `jest.clearAllMocks()` in `afterEach`\n\n## E2E Testing\n\n- **Database**: Use real test DB (Docker). Never mock DB in E2E.\n- **Cleanup**: Mandatory. Use transaction rollback or `TRUNCATE` in `afterEach`.\n- **App Init**: Create app in `beforeAll`, close in `afterAll`\n- **Guards**: Override via `.overrideGuard(X).useValue({ canActivate: () => true })`\n\n## Strict TypeScript (MANDATORY)\n\n- **No `any`**: Use typed objects, `jest.Mocked\u003CT>`, or `as unknown as T`. Never `as any`.\n- **No `eslint-disable`**: Fix underlying type issue. No exceptions.\n- **Verify DTO shapes**: Read actual DTO class before writing mock data.\n- **Cast Jest matchers**: Nested `expect.anything()` → `expect.anything() as unknown`.\n- **No unused vars**: Only declare variables if referenced in assertions or setup.\n\n## Anti-Patterns\n\n- **No Private Tests**: Test via public methods, not `service['privateMethod']`.\n  When coverage requires it, use typed helper (see strict-typescript reference).\n- **No DB Mocks in E2E**: Use real DB with cleanup. Mocks defeat E2E purpose.\n- **No Shared State**: Call `jest.clearAllMocks()` in `afterEach`. Random failures otherwise.\n- **No Resource Leaks**: Always close app and DB in `afterAll`.\n\n## References\n\nSetup examples, mocking patterns, E2E flows, test builders, coverage config:\n[references\u002Fpatterns.md](references\u002Fpatterns.md)\n\nStrict-TypeScript patterns (Jest matchers, mock typing, DTO verification):\n[references\u002Fstrict-typescript-testing.md](references\u002Fstrict-typescript-testing.md)\n\n","# NestJS Testing\n\n## **Priority: P2 (MAINTENANCE)**\n\n## Structure\n\n```\nsrc\u002F**\u002F*.spec.ts      # Unit tests (isolated logic)\ntest\u002F**\u002F*.e2e-spec.ts # E2E tests (full app flows)\n```\n\n## Unit Testing\n\n- **Setup**: Use `Test.createTestingModule()` with mocked providers\n- **Mocks**: Mock all dependencies via `{ provide: X, useValue: mockX }`\n- **Pattern**: AAA (Arrange-Act-Assert)\n- **Cleanup**: Call `jest.clearAllMocks()` in `afterEach`\n\n## E2E Testing\n\n- **Database**: Use real test DB (Docker). Never mock DB in E2E.\n- **Cleanup**: Mandatory. Use transaction rollback or `TRUNCATE` in `afterEach`.\n- **App Init**: Create app in `beforeAll`, close in `afterAll`\n- **Guards**: Override via `.overrideGuard(X).useValue({ canActivate: () => true })`\n\n## Strict TypeScript (MANDATORY)\n\n- **No `any`**: Use typed objects, `jest.Mocked\u003CT>`, or `as unknown as T`. Never `as any`.\n- **No `eslint-disable`**: Fix underlying type issue. No exceptions.\n- **Verify DTO shapes**: Read actual DTO class before writing mock data.\n- **Cast Jest matchers**: Nested `expect.anything()` → `expect.anything() as unknown`.\n- **No unused vars**: Only declare variables if referenced in assertions or setup.\n\n## Anti-Patterns\n\n- **No Private Tests**: Test via public methods, not `service['privateMethod']`.\n  When coverage requires it, use typed helper (see strict-typescript reference).\n- **No DB Mocks in E2E**: Use real DB with cleanup. Mocks defeat E2E purpose.\n- **No Shared State**: Call `jest.clearAllMocks()` in `afterEach`. Random failures otherwise.\n- **No Resource Leaks**: Always close app and DB in `afterAll`.\n\n## References\n\nSetup examples, mocking patterns, E2E flows, test builders, coverage config:\n[references\u002Fpatterns.md](references\u002Fpatterns.md)\n\nStrict-TypeScript patterns (Jest matchers, mock typing, DTO verification):\n[references\u002Fstrict-typescript-testing.md](references\u002Fstrict-typescript-testing.md)\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-testing",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill nestjs-testing",{"tool":59,"command":60},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill nestjs-testing",{"tool":62,"command":63},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill nestjs-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-testing\u002FSKILL.md",true,[],[68,77,86,95,101,107],{"skillNo":69,"name":70,"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":71,"categories":72,"keywords":73,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[74,75,76],"model","model hierarchy","model hierarchy skill",{"skillNo":78,"name":79,"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":80,"categories":81,"keywords":82,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[83,84,85],"MCP","zoom","zoom mcp",{"skillNo":87,"name":88,"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":89,"categories":90,"keywords":91,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[92,93,94,84],"sdk","zoom apps sdk","apps",{"skillNo":96,"name":97,"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":98,"categories":99,"keywords":100,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[97],{"skillNo":102,"name":103,"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":104,"categories":105,"keywords":106,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[103],{"skillNo":108,"name":109,"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":110,"categories":111,"keywords":112,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[109]]