Skip to content

[Community Skill] Jest#6

Open
Mane087 wants to merge 2 commits intoGentleman-Programming:mainfrom
Mane087:add-skill-jest
Open

[Community Skill] Jest#6
Mane087 wants to merge 2 commits intoGentleman-Programming:mainfrom
Mane087:add-skill-jest

Conversation

@Mane087
Copy link
Copy Markdown

@Mane087 Mane087 commented Jan 22, 2026

Community Skill Submission

Skill Name

Jest

Description

Project-agnostic Jest patterns for modern TypeScript/JavaScript testing. Covers:

  • Test structure (Arrange/Act/Assert, describe/it conventions)
  • Matchers and expect best practices
  • Async testing (Promises, async/await, rejects, assertion counts)
  • Setup/teardown and test isolation
  • Mocking strategy (boundary-first, spies vs module mocks)
  • Mock functions API (jest.fn, call assertions)
  • Manual mocks (mocks) and class mocks
  • Timer mocks (fake timers, advancing time)
  • Snapshot testing (responsible usage and maintenance)
  • Platform/environment configuration (node vs jsdom)
  • Coverage practices and CI-friendly runs

Why This Skill?

Jest is widely used across frontend, backend, and shared libraries. This skill helps AI assistants produce deterministic, maintainable, low-flake tests and choose correct mocking/testing patterns without over-mocking or introducing brittle snapshots.

Checklist

  • [ x ] Skill is in the community/ folder
  • [ x ] Includes SKILL.md with proper structure
  • [ x ] Has clear trigger conditions
  • [ x ] Includes at least 3 code examples
  • [ x ] Lists anti-patterns to avoid
  • [ x ] Tested with Claude Code or OpenCode
  • [ x ] Not a duplicate of existing skills

Framework/Library Version

Jest 29+ (recommended baseline; works with modern TS/ESM setups)

Testing

Validated patterns across multiple TS/JS codebases:

  • Node services and libraries (testEnvironment: node)
  • Frontend utilities (testEnvironment: jsdom)
  • Async-heavy modules (Promise flows, error handling)
  • Time-based logic (debounce/throttle/polling using fake timers)
  • Snapshot usage limited to stable serialized outputs

Notes: This submission is project-agnostic and focuses on reusable patterns. Repo-specific conventions (ts-jest vs babel-jest, ESM vs CJS) should be added as references/ in downstream skills.


Voting

Community members: Please vote using reactions!

  • Approve - Use any positive reaction (thumbs up, heart, rocket, etc.)
  • Reject - Use thumbs down reaction

Voting period: 7 days from PR creation.

@Alan-TheGentleman
Copy link
Copy Markdown
Contributor

Review Summary

Hey @Mane087! Great Jest skill submission. Here's what needs to be fixed for CI to pass:

1. Frontmatter Format Issue

The frontmatter has a formatting problem - there's an extra line with dashes at the end that shouldn't be there:

---

name: jest
description: >
...
allowed-tools: Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task
-----------------------------------------------------------------------------   # ← Remove this line

Should be:

---
name: jest
description: >
  Jest testing patterns and best practices for modern TypeScript/JavaScript projects.
  Trigger: Writing, refactoring, or reviewing Jest unit/integration tests.
metadata:
  author: gentleman-programming
  version: "1.0"
---

2. Remove Extra Fields

Remove these non-standard fields from frontmatter:

  • license
  • allowed-tools

What's Good

  • Excellent content coverage (matchers, async, mocks, timers, snapshots)
  • Great code examples
  • Proper conventional commit format

Once you fix the frontmatter, CI should pass. Thanks for contributing!

@Mane087
Copy link
Copy Markdown
Author

Mane087 commented Jan 24, 2026

Ok, I got it. I'm gonna apply those suggestions

@github-actions
Copy link
Copy Markdown
Contributor

🗳️ Community Skill Voting

Thank you for submitting jest!

How to Vote

Community members, please vote using reactions on this PR:

Vote Reaction
Approve 👍 👏 🎉 🚀 ❤️ (any positive)
Reject 👎

Voting Period

Ends: Saturday, January 31, 2026 (7 days from now)

Acceptance Criteria


This comment was automatically generated. Maintainers may fast-track exceptional contributions.

@github-actions
Copy link
Copy Markdown
Contributor

⏰ Voting Period Ended

Unfortunately, this PR did not receive the minimum required votes (3).

Results: +0 / -0 (0 total votes)

The PR will remain open for another week. Please help spread the word!

If no votes are received in the extended period, this PR may be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants