{"id":"06338177-72b6-44bf-8d29-6bc64537fdd2","shortId":"aSU3uq","kind":"skill","title":"Javascript Typescript Jest","tagline":"Awesome Copilot skill by Github","description":"### Test Structure\n- Name test files with `.test.ts` or `.test.js` suffix\n- Place test files next to the code they test or in a dedicated `__tests__` directory\n- Use descriptive test names that explain the expected behavior\n- Use nested describe blocks to organize related tests\n- Follow the pattern: `describe('Component/Function/Class', () => { it('should do something', () => {}) })`\n\n### Effective Mocking\n- Mock external dependencies (APIs, databases, etc.) to isolate your tests\n- Use `jest.mock()` for module-level mocks\n- Use `jest.spyOn()` for specific function mocks\n- Use `mockImplementation()` or `mockReturnValue()` to define mock behavior\n- Reset mocks between tests with `jest.resetAllMocks()` in `afterEach`\n\n### Testing Async Code\n- Always return promises or use async/await syntax in tests\n- Use `resolves`/`rejects` matchers for promises\n- Set appropriate timeouts for slow tests with `jest.setTimeout()`\n\n### Snapshot Testing\n- Use snapshot tests for UI components or complex objects that change infrequently\n- Keep snapshots small and focused\n- Review snapshot changes carefully before committing\n\n### Testing React Components\n- Use React Testing Library over Enzyme for testing components\n- Test user behavior and component accessibility\n- Query elements by accessibility roles, labels, or text content\n- Use `userEvent` over `fireEvent` for more realistic user interactions\n\n## Common Jest Matchers\n- Basic: `expect(value).toBe(expected)`, `expect(value).toEqual(expected)`\n- Truthiness: `expect(value).toBeTruthy()`, `expect(value).toBeFalsy()`\n- Numbers: `expect(value).toBeGreaterThan(3)`, `expect(value).toBeLessThanOrEqual(3)`\n- Strings: `expect(value).toMatch(/pattern/)`, `expect(value).toContain('substring')`\n- Arrays: `expect(array).toContain(item)`, `expect(array).toHaveLength(3)`\n- Objects: `expect(object).toHaveProperty('key', value)`\n- Exceptions: `expect(fn).toThrow()`, `expect(fn).toThrow(Error)`\n- Mock functions: `expect(mockFn).toHaveBeenCalled()`, `expect(mockFn).toHaveBeenCalledWith(arg1, arg2)`","tags":["javascript","typescript","jest","awesome","copilot","github"],"capabilities":["skill","source-github","category-awesome-copilot"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/javascript-typescript-jest","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T19:40:26.714Z","embedding":null,"createdAt":"2026-04-18T20:25:15.431Z","updatedAt":"2026-04-22T19:40:26.714Z","lastSeenAt":"2026-04-22T19:40:26.714Z","tsv":"'/pattern':220 '3':211,215,233 'access':169,173 'aftereach':100 'alway':104 'api':65 'appropri':120 'arg1':256 'arg2':257 'array':225,227,231 'async':102 'async/await':109 'awesom':4 'basic':191 'behavior':42,92,166 'block':46 'care':149 'category-awesome-copilot' 'chang':139,148 'code':25,103 'commit':151 'common':188 'complex':136 'compon':134,154,163,168 'component/function/class':55 'content':178 'copilot':5 'databas':66 'dedic':31 'defin':90 'depend':64 'describ':45,54 'descript':35 'directori':33 'effect':60 'element':171 'enzym':160 'error':247 'etc':67 'except':240 'expect':41,192,195,196,199,201,204,208,212,217,221,226,230,235,241,244,250,253 'explain':39 'extern':63 'file':13,21 'fireev':182 'fn':242,245 'focus':145 'follow':51 'function':83,249 'github':8 'infrequ':140 'interact':187 'isol':69 'item':229 'javascript':1 'jest':3,189 'jest.mock':73 'jest.resetallmocks':98 'jest.settimeout':126 'jest.spyon':80 'keep':141 'key':238 'label':175 'level':77 'librari':158 'matcher':116,190 'mock':61,62,78,84,91,94,248 'mockfn':251,254 'mockimplement':86 'mockreturnvalu':88 'modul':76 'module-level':75 'name':11,37 'nest':44 'next':22 'number':207 'object':137,234,236 'organ':48 'pattern':53 'place':19 'promis':106,118 'queri':170 'react':153,156 'realist':185 'reject':115 'relat':49 'reset':93 'resolv':114 'return':105 'review':146 'role':174 'set':119 'skill':6 'slow':123 'small':143 'snapshot':127,130,142,147 'someth':59 'source-github' 'specif':82 'string':216 'structur':10 'substr':224 'suffix':18 'syntax':110 'test':9,12,20,27,32,36,50,71,96,101,112,124,128,131,152,157,162,164 'test.js':17 'test.ts':15 'text':177 'timeout':121 'tobe':194 'tobefalsi':206 'tobegreaterthan':210 'tobelessthanorequ':214 'tobetruthi':203 'tocontain':223,228 'toequal':198 'tohavebeencal':252 'tohavebeencalledwith':255 'tohavelength':232 'tohaveproperti':237 'tomatch':219 'tothrow':243,246 'truthi':200 'typescript':2 'ui':133 'use':34,43,72,79,85,108,113,129,155,179 'user':165,186 'userev':180 'valu':193,197,202,205,209,213,218,222,239","prices":[{"id":"905e84df-ad62-4e20-b2dc-cd0a2c5a0caf","listingId":"06338177-72b6-44bf-8d29-6bc64537fdd2","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:25:15.431Z"}],"sources":[{"listingId":"06338177-72b6-44bf-8d29-6bc64537fdd2","source":"github","sourceId":"github/awesome-copilot/javascript-typescript-jest","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/javascript-typescript-jest","isPrimary":false,"firstSeenAt":"2026-04-18T21:49:59.234Z","lastSeenAt":"2026-04-22T18:52:58.017Z"},{"listingId":"06338177-72b6-44bf-8d29-6bc64537fdd2","source":"skills_sh","sourceId":"github/awesome-copilot/javascript-typescript-jest","sourceUrl":"https://skills.sh/github/awesome-copilot/javascript-typescript-jest","isPrimary":true,"firstSeenAt":"2026-04-18T20:25:15.431Z","lastSeenAt":"2026-04-22T19:40:26.714Z"}],"details":{"listingId":"06338177-72b6-44bf-8d29-6bc64537fdd2","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"javascript-typescript-jest","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/javascript-typescript-jest"},"updatedAt":"2026-04-22T19:40:26.714Z"}}