nestjs-testing

nestjs-testing is a skill for Claude Code from dkmqflx/nestjs-best-practices-plugin. It costs 62 tokens per session (604 once invoked), scanned A, original, MIT.

A set of NestJS testing guidelines for isolated unit tests and end-to-end tests. NestJS is a TypeScript server framework, and end-to-end tests check the application through its HTTP interface.

In plain words
What is it for?
Use it when writing or reviewing NestJS tests for controllers, services, mocked dependencies, or HTTP flows.
Why use it?
It helps tests check the right layer, avoid dependence on a real database, and cover complete request flows reliably.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the nestjs-best-practices plugin — 12 skills shipped together

Good fit Use it when writing or reviewing NestJS tests for controllers, services, mocked dependencies, or HTTP flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-testing
Clone the repo
git clone --depth 1 https://github.com/dkmqflx/nestjs-best-practices-plugin

Made for: Claude Code.

Or install nestjs-best-practices, the plugin that ships this one along with the rest of its 12 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nestjs-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing/github.svg)](https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing)
Your own site
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nestjs-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 604 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.00604
Opus 5 $0.00031 $0.00302
Sonnet 5 $0.00012 $0.00121
Haiku 4.5 $0.00006 $0.00060

Measured 8d ago against content hash 8f59d7349105, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

nestjs-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/nestjs-best-practices/skills/nestjs-testing/SKILL.md · 57 lines

How it starts

The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.

NestJS Testing

Best practices for testing NestJS applications, following the official testing docs (https://docs.nestjs.com/fundamentals/testing). Covers isolated unit tests built with Test.createTestingModule and full-stack e2e tests driven through supertest. Each rule pairs an antipattern with the idiomatic Jest pattern.

When to Apply

Reference these guidelines when:

  • Writing unit tests for a controller or service with Test.createTestingModule
  • Mocking a unit's dependencies (repositories, HTTP clients, other services)
  • Writing e2e tests that hit the real HTTP server via supertest
  • Bypassing guards/auth or swapping providers in e2e
  • Managing test data, fixtures, and teardown between tests
  • Reviewing or refactoring an existing NestJS test suite

Rules

  • test-createtestingmodule (CRITICAL) — build the unit under test with Test.createTestingModule(...).compile()
  • mock-dependencies (CRITICAL) — provide mock providers (useValue) for every dependency of the unit
  • unit-test-services (HIGH) — test service logic against mocked repos/clients, never a real DB
  • e2e-with-supertest (HIGH) — exercise the whole app over HTTP with createNestApplication + supertest
  • override-guards-in-e2e (HIGH) — bypass auth in e2e with overrideGuard / overrideProvider
  • isolated-test-data (HIGH) — fresh fixtures per test; reset mocks and tear down the app/DB between tests
  • test-behavior-not-implementation (MEDIUM) — assert returned values and HTTP contracts, not internal call shapes

How to Use

Read the individual rule file for the explanation and before/after example:

rules/test-createtestingmodule.md
rules/mock-dependencies.md
rules/unit-test-services.md
rules/e2e-with-supertest.md
rules/override-guards-in-e2e.md
rules/isolated-test-data.md
rules/test-behavior-not-implementation.md

Each rule file contains:

  • A short explanation of why it matters, tied to the official docs
  • An Incorrect example (the antipattern)
  • A Correct example (the idiomatic NestJS + Jest pattern)

Read the full file on GitHub · 57 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 57 lines · 62 tokens per session scan A 8f59d7349105

Subscribe to this mod's changes

nestjs-testing is a skill published in the GitHub repository dkmqflx/nestjs-best-practices-plugin (1 stars, last pushed 2mo ago), licensed MIT. It adds 62 tokens to every session and 604 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.