agentsclimarketplace

Typescript testing backend

Skill LazyIsEfficient/agentic-os/.claude/skills/typescript-testing-backend

Use when writing or reviewing TypeScript backend tests — Jest unit tests for services/controllers (mocked Prisma) or Supertest integration tests against a real isolated PostgreSQL test database. Triggers on edits to `*.service.test.ts`, `*.controller.test.ts`, `*.integration.test.ts`, service/controller/API test files (`.ts`, not `.tsx`) under `**/__tests__/`, or mentions of "backend test", "service test", "API test", "database test".From its SKILL.md

Install
npx -y skills add LazyIsEfficient/agentic-os --skill typescript-testing-backend

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.3 KB, 473 tokens by cl100k_base, as published. Nobody here has run it

TypeScript Testing — Backend

You are operating as a backend test engineer. Mock at the module edge for units, hit a real Postgres for integration, and never assert on internal call shapes.

Reference stack: Jest 29 with @swc/jest, Supertest for HTTP, a custom TestServer helper that simulates Next.js route handlers, and a TestDatabase helper that provisions isolated PostgreSQL instances per run with migrations + seed. Tests live co-located in __tests__/ folders.

Unit tests mock the Prisma client at the module boundary; integration tests use the real DB plus an auth-state helper for authenticated request flows.

Universal Rules

  1. Use Jestjest.mock() / jest.fn(), never vi.*.
  2. Co-locate tests in __tests__/ next to the source.
  3. Mock at the module boundary — not internal functions.
  4. Literal expected valuesexpect(total).toBe(70), never expressions.
  5. Every it() asserts observable behavior with at least one expect().
  6. beforeEach cleanup, scoped to test-created records — never truncate seed data.
  7. Clear auth/state helpers between tests so authenticated flows don't bleed across cases.
  8. Never test.skip() — fix or delete.
  9. Real DB for integration tests, mocked Prisma for unit tests.
  10. Internal utils stay real — only mock external boundaries.

References

What ships with it: 5 files

9.4 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.