All skills
asyrafhussin avatar

/testing-best-practices

@575c801

Unit testing, integration testing, and test-driven development principles. Use when writing tests, reviewing test code, improving test coverage, or setting up testing strategy. Triggers on "write tests", "review tests", "testing best practices", or "TDD".

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/testing-best-practices

This session only. Nothing lands on disk.

rules_template.md

≈336 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Rule Title

Brief one-sentence description of the principle.

Bad Example

// Comment explaining why this is problematic
describe('ComponentName', () => {
  test('demonstrates antipattern', () => {
    // Code showing what NOT to do
    // Multiple aspects of the problem
    expect(something).toBe(wrong);
  });
});

Good Example

// Comment explaining the correct approach
describe('ComponentName', () => {
  // Setup if needed
  beforeEach(() => {
    // Clean setup
  });

  test('demonstrates best practice', () => {
    // Arrange
    const input = prepareTestData();

    // Act
    const result = functionUnderTest(input);

    // Assert
    expect(result).toBe(expected);
  });

  test('handles edge case correctly', () => {
    // Additional test showing the pattern
  });
});

Why

  1. Benefit 1: Explanation of why this matters
  2. Benefit 2: Impact on test quality
  3. Benefit 3: Developer experience improvement
  4. Benefit 4: Maintenance and debugging advantages

Guidelines:

  • Specific guideline or tip
  • When to apply this pattern
  • What to watch out for
  • Tools or libraries that help

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive guidelines and best practices for unit testing, integration testing, and Test-Driven Development (TDD). It consists entirely of documentation and illustrative code examples using industry-standard tools like Jest and Vitest. No security risks or malicious patterns were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    29 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 575c801. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
metadata
{
  "author": "agent-skills",
  "version": "2.0.0"
}

README badge

README badge for asyrafhussin/agent-skills/testing-best-practices