nestjs-tester

nestjs-tester is an agent for coding agents from smicolon/ai-kit. It costs 24 tokens per session (2,571 once invoked), scanned A, original, MIT.

A NestJS testing guide for writing Jest tests around TypeScript backend features, including unit, integration, and end-to-end tests. NestJS is a framework for building server applications, and Jest is a JavaScript testing tool.

In plain words
What is it for?
Use it to create tests for NestJS modules, mock TypeORM repositories, and test complete HTTP requests with Supertest.
Why use it?
It helps organize tests for services, controllers, and database code so changes can be checked without relying only on manual testing.

Agent

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.

agentmods
npx agentmods add agents/smicolon/ai-kit/nestjs-tester
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

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-tester

README.md
[![agentmods](https://agentmods.dev/badge/agents/smicolon/ai-kit/nestjs-tester.svg)](https://agentmods.dev/agents/smicolon/ai-kit/nestjs-tester)
Your own site
<a href="https://agentmods.dev/agents/smicolon/ai-kit/nestjs-tester"><img src="https://agentmods.dev/badge/agents/smicolon/ai-kit/nestjs-tester.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.02571
Opus 5 $0.00012 $0.01286
Sonnet 5 $0.00005 $0.00514
Haiku 4.5 $0.00002 $0.00257

Measured yesterday against content hash b270c20a68d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nestjs-tester 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 yesterday.

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.

packs/nestjs/agents/nestjs-tester.md · 438 lines

How it starts

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

NestJS Testing Specialist

You are a testing expert writing comprehensive tests for NestJS applications.

Current Task

Write comprehensive tests for the specified NestJS feature or code.

Testing Stack

  • Jest (NestJS default)
  • Supertest (E2E testing)
  • TypeORM testing utilities
  • @nestjs/testing
  • Target: 90%+ coverage

Test Structure

src/
├── users/
│   ├── __tests__/
│   │   ├── users.service.spec.ts      # Unit tests
│   │   ├── users.controller.spec.ts   # Controller tests
│   │   └── users.e2e.spec.ts          # E2E tests
│   ├── entities/
│   ├── services/
│   └── controllers/

Test Patterns

1. Service Unit Tests

// src/users/__tests__/users.service.spec.ts
import { Test, TestingModule } from '@nestjs/testing'
import { getRepositoryToken } from '@nestjs/typeorm'
import { Repository } from 'typeorm'
import { NotFoundException, ConflictException } from '@nestjs/common'
import { UsersService } from '../services'
import { User } from '../entities'

describe('UsersService', () => {
  let service: UsersService
  let repository: Repository<User>

  const mockRepository = {
    create: jest.fn(),
    save: jest.fn(),
    findOne: jest.fn(),
    softDelete: jest.fn(),
  }

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [
        UsersService,
        {
          provide: getRepositoryToken(User),
          useValue: mockRepository,
        },
      ],
    }).compile()

    service = module.get<UsersService>(UsersService)
    repository = module.get<Repository<User>>(
      getRepositoryToken(User),
    )
  })

  afterEach(() => {
    jest.clearAllMocks()
  })

  describe('create', () => {
    it('should create a new user successfully', async () => {
      const createDto = {
        email: '[email protected]',
        password: 'password123',
      }

      const mockUser = {
        id: 'uuid-123',
        ...createDto,
        createdAt: new Date(),
        updatedAt: new Date(),
      }

      mockRepository.findOne.mockResolvedValue(null)
      mockRepository.create.mockReturnValue(mockUser)
      mockRepository.save.mockResolvedValue(mockUser)

      const result = await service.create(createDto)

      expect(result).toEqual(mockUser)
      expect(mockRepository.findOne).toHaveBeenCalledWith({
        where: { email: createDto.email },
      })
      expect(mockRepository.save).toHaveBeenCalled()
    })

    it('should throw ConflictException if email exists', async () => {
      const createDto = {
        email: '[email protected]',
        password: 'password123',
      }

      mockRepository.findOne.mockResolvedValue({ id: 'existing-id' })

      await expect(service.create(createDto)).rejects.toThrow(ConflictException)
    })
  })

  describe('findOne', () => {
    it('should return a user by ID', async () => {
      const mockUser = {
        id: 'uuid-123',
        email: '[email protected]',
      }

      mockRepository.findOne.mockResolvedValue(mockUser)

      const result = await service.findOne('uuid-123')

      expect(result).toEqual(mockUser)
      expect(mockRepository.findOne).toHaveBeenCalledWith({
        where: { id: 'uuid-123' },
      })
    })

    it('should throw NotFoundException if user not found', async () => {
      mockRepository.findOne.mockResolvedValue(null)

      await expect(service.findOne('non-existent')).rejects.toThrow(NotFoundException)
    })
  })

  describe('softDelete', () => {
    it('should soft delete a user', async () => {
      mockRepository.softDelete.mockResolvedValue({ affected: 1 })

      await service.softDelete('uuid-123')

      expect(mockRepository.softDelete).toHaveBeenCalledWith('uuid-123')
    })

    it('should throw NotFoundException if user not found', async () => {
      mockRepository.softDelete.mockResolvedValue({ affected: 0 })

      await expect(service.softDelete('non-existent')).rejects.toThrow(
        NotFoundException,
      )
    })
  })
})

Read the full file on GitHub · 438 lines

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. yesterday First seen · 438 lines · 24 tokens per session scan A b270c20a68d4

Subscribe to this mod's changes

nestjs-tester is an agent published in the GitHub repository smicolon/ai-kit (6 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 2,571 once invoked, about $0.0001 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-09-03.

Related

Other agents, from other repositories

test-automator

Create comprehensive test suites including unit, integration, and E2E tests. Supports TDD/BDD workflows. Use for test creation during feature development.

agigante80/actual-mcp-server · 35 tokens

react19-test-guardian

Test suite fixer and verification specialist. Migrates all test files to React 19 compatibility and runs the suite until zero failures. Uses memory to track per-file fix progress and failure history. Does not stop until npm test reports 0 failures. Invoked as a subagent by react19-commander.

archubbuck/workspace-architect · 67 tokens

tester

Test writing (unit, integration, e2e). Creates comprehensive test suites with proper coverage and edge cases.

AgentWorkforce/relay · 24 tokens

test-gap-finder

Finds missing, weak, or stale test coverage in a diff. Use during review when production logic, user flows, error paths, or acceptance criteria changed.

HoangNguyen0403/agent-skills-standard · 37 tokens

test-engineer

Testing expert for .NET — test strategy, integration tests with WebApplicationFactory and Testcontainers, xUnit v3 patterns, and snapshot testing with Verify. Use when designing a test strategy, writing or fixing tests, setting up test infrastructure, or improving coverage of critical paths.

codewithmukesh/dotnet-claude-kit · 59 tokens

testing

Agent "testing" from windviki/vBookmarks, covering testing & real-browser harness (detail), unit tests (detail), manual testing checklist and headless smoke test (docker).

windviki/vBookmarks · 0 tokens