Agent skill

Tsed Testing

by tsedio in tsedio/tsed

Write unit and integration tests for Ts.ED v8 applications with Vitest (Jest as a fallback) - vitest.config with unplugin-swc, PlatformTest.create/invoke/reset from @tsed/platform-http/testing…

MITAuto-check passedTesting & QA

Install Tsed Testing

skills CLI
$ npx skills add tsedio/tsed --skill tsed-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tsedio/tsed tsed-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tsedio/tsed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/tsed/skills/tsed-testing .claude/skills/tsed-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tsed-testing
GitHub stars
3.1k
Token cost
~2k tokens
SKILL.md length
603 words
Files
3 (incl. references)
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Write unit and integration tests for Ts.ED v8 applications with Vitest (Jest as a fallback) - vitest.config with unplugin-swc, PlatformTest.create/invoke/reset from @tsed/platform-http/testing…

  • Works in 6 steps: Configure Vitest → Choose the test type → Unit test a provider → …
  • Fixing .spec.ts files for services
  • SKILL.md covers 1. Configure Vitest, 2. Choose the test type, 3. Unit test a provider and 4. Mock dependencies, plus 4 more sections
  • Calls vitest; reaches tsed.dev

What it does

Tsed Testing is an agent skill from tsedio/tsed. Write unit and integration tests for Ts.ED v8 applications with Vitest (Jest as a fallback) - vitest.config with unplugin-swc, PlatformTest.create/invoke/reset from @tsed/platform-http/testing, provider mocking with {token, use}, inject() in specs, PlatformTest.createRequestContext, and PlatformTest.bootstrap(Server) with SuperTest and PlatformTest.callback(). Use when adding or fixing .spec.ts files for services, controllers, middlewares or interceptors, when injected properties are undefined in tests, or on the…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/recipes.md`).

It sits in Testing & QA, covering Unit testing and Integration testing. It works with Vitest and Jest. The repository describes itself as: :triangularruler: Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline… The licence is MIT.

When your agent uses it

  • Fixing .spec.ts files for services
  • Injected properties are undefined in tests
  • On the error Platform type is not specified / a missing platform adapter

Example prompts

  • “Platform type is not specified”
  • “/tsed-testing”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Configure Vitest
  2. Choose the test type
  3. Unit test a provider
  4. Mock dependencies
  5. Integration test with SuperTest
  6. Use real infrastructure sparingly

What it can do on your machine

Read from SKILL.md and the folder at commit cebcc11. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • vitest

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • tsed.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tsed Testing loads about 2k tokens when it runs, and up to ~4k if it reads all its reference files. Until then it costs about 150 tokens; SKILL.md has 603 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~150
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tsedio/tsed at commit cebcc11, republished under its MIT licence (© tsedio). 603 words, ~2,010 tokens.

Download SKILL.mdSave it as .claude/skills/tsed-testing/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
tsed-testing
description
Write unit and integration tests for Ts.ED v8 applications with Vitest (Jest as a fallback) - vitest.config with unplugin-swc, PlatformTest.create/invoke/reset from @tsed/platform-http/testing, provider mocking with {token, use}, inject() in specs, PlatformTest.createRequestContext, and PlatformTest.bootstrap(Server) with SuperTest and PlatformTest.callback(). Use when adding or fixing *.spec.ts files for services, controllers, middlewares or interceptors, when injected properties are undefined in tests, or on the error "Platform type is not specified" / a missing platform adapter.

Test a Ts.ED Application

Build every tested class through the Ts.ED test injector. Never instantiate a DI-managed class (service, controller, middleware, interceptor, module) with new in a test: it bypasses injection, scopes, hooks and mocks.

Read the testing recipes for middleware, interceptor, request-context and stubbing examples. Depth: https://tsed.dev/docs/testing.md, https://tsed.dev/tutorials/vitest.md.

1. Configure Vitest

Install vitest unplugin-swc @swc/core @vitest/coverage-v8 (and supertest @types/supertest for integration tests). A project generated by tsed-cli already has this.

typescript
// vitest.config.mts
import swc from "unplugin-swc";
import {defineConfig} from "vitest/config";

export default defineConfig({
  test: {globals: true, root: "./"},
  plugins: [
    swc.vite({
      jsc: {
        target: "es2022",
        keepClassNames: true,
        parser: {syntax: "typescript", decorators: true},
        transform: {useDefineForClassFields: false, legacyDecorator: true, decoratorMetadata: true}
      }
    })
  ]
});
  • Do not rely on Vitest's default esbuild transform: it does not emit decorator metadata, so constructor and @Inject() property injection resolve to undefined.
  • Do not remove useDefineForClassFields: false; class fields would overwrite injected properties.
  • Jest: use ts-jest per https://tsed.dev/tutorials/jest.md. It is unstable with ESM; prefer Vitest for new projects.

2. Choose the test type

  1. Logic of one provider with mocked collaborators: unit test with PlatformTest.create() (steps 3-4). Fast, no HTTP server.
  2. Routing, validation, serialization, middlewares chain, exception filters: integration test with PlatformTest.bootstrap(Server) + SuperTest (step 5).
  3. Real database or broker: add a testcontainers package (step 6).

3. Unit test a provider

typescript
import {inject} from "@tsed/di";
import {PlatformTest} from "@tsed/platform-http/testing";
import {afterEach, beforeEach, describe, expect, it} from "vitest";
import {UsersService} from "./UsersService.js";

describe("UsersService", () => {
  beforeEach(() => PlatformTest.create());
  afterEach(() => PlatformTest.reset());

  it("should return the user", async () => {
    const service = inject(UsersService);

    expect(await service.findById("1")).toEqual({id: "1"});
  });
});
  • PlatformTest.create(settings?) accepts any configuration key: PlatformTest.create({features: {beta: true}}) then read it with constant("features.beta").
  • PlatformTest.get(Token) and inject(Token) return the shared instance. PlatformTest.injector is the InjectorService.
  • Import inject from @tsed/di. @tsed/platform-http/testing only exports PlatformTest and FakeAdapter.
  • For code without HTTP dependencies, DITest from @tsed/di offers the same create, invoke, get, reset.

4. Mock dependencies

typescript
const repository = {findById: vi.fn().mockResolvedValue({id: "1"})};

const service = await PlatformTest.invoke<UsersService>(UsersService, [{token: UsersRepository, use: repository}]);

expect(await service.findById("1")).toEqual({id: "1"});
expect(repository.findById).toHaveBeenCalledWith("1");
  • PlatformTest.invoke(Token, [{token, use}]) builds a fresh instance with local mocks and runs $onInit. Always await it.
  • Mock for the whole describe: PlatformTest.create({imports: [{token: UsersRepository, use: repository}]}), then inject(UsersService).
  • imports entries accept use, useClass, useFactory or useAsyncFactory. useValue is ignored there.
  • Symbol or factory tokens are mocked the same way: {token: DbConnection, use: fakeDb}.
  • Controllers are providers: await PlatformTest.invoke<UsersController>(UsersController, [...]) and call the handler method directly with plain arguments.
  • Mock only direct collaborators. Do not vi.mock() a class file that the injector must still register.

5. Integration test with SuperTest

typescript
import {PlatformTest} from "@tsed/platform-http/testing";
import SuperTest from "supertest";
import {afterAll, beforeAll, describe, expect, it} from "vitest";
import {Server} from "../Server.js";
import {UsersController} from "./UsersController.js";

describe("UsersController", () => {
  beforeAll(PlatformTest.bootstrap(Server, {mount: {"/rest": [UsersController]}}));
  afterAll(PlatformTest.reset);

  it("should call GET /rest/users/:id", async () => {
    const request = SuperTest(PlatformTest.callback());
    const response = await request.get("/rest/users/1").expect(200);

    expect(response.body).toEqual({id: "1"});
  });
});
  • PlatformTest.bootstrap() returns a function; pass it to beforeAll, or call it: await PlatformTest.bootstrap(Server)().
  • The platform adapter must be registered: import @tsed/platform-express (or -koa, -fastify) in Server.ts or in the spec, or pass {adapter: PlatformExpress}.
  • No port is opened unless listen: true is passed. The environment is test and the logger level is off by default.
  • Settings passed as second argument replace the same @Configuration keys (only mount, scopes, logger are merged). Passing imports drops the Server's own imports.
  • Stub after bootstrap: vi.spyOn(PlatformTest.get(UsersService), "findById").mockResolvedValue(...).
Show full SKILL.md (206 more words)Show less

6. Use real infrastructure sparingly

Point to @tsed/testcontainers-mongo (https://tsed.dev/tutorials/mongoose.md) and the premium @tsedio/testcontainers-* packages (Postgres, Redis, Vault) listed in https://tsed.dev/docs/testing.md. Do not hand-roll container lifecycle code when a package exists.

Pitfalls

  • "Platform type is not specified" (older releases) or a crash while creating the platform adapter in PlatformTest.bootstrap: no adapter package was imported. Add import "@tsed/platform-express";.
  • beforeEach(PlatformTest.create) passes Vitest's test context as settings. Write beforeEach(() => PlatformTest.create()).
  • Missing PlatformTest.reset leaks providers, hooks and mocks into the next file and keeps handles open.
  • PlatformTest.invoke without await returns a promise; assertions then run on the promise.
  • PlatformTest.inject([Token], cb) is deprecated. Use inject() or PlatformTest.invoke().
  • Services reading context() need runInContext(PlatformTest.createRequestContext(), () => ...) from @tsed/di.
  • One PlatformTest.bootstrap per file in beforeAll, not beforeEach: bootstrapping the server per test is slow.
  • Do not import from @tsed/common; PlatformTest lives in @tsed/platform-http/testing.

Checklist

  • vitest.config uses unplugin-swc with decorators, legacyDecorator, decoratorMetadata and useDefineForClassFields: false.
  • No new on a DI-managed class anywhere in the specs; instances come from inject(), PlatformTest.get() or PlatformTest.invoke().
  • Every PlatformTest.create/bootstrap has a matching PlatformTest.reset.
  • Mocks use {token, use} and are asserted with toHaveBeenCalledWith; success and error paths are covered.
  • Integration specs import the platform adapter and build requests with SuperTest(PlatformTest.callback()).
  • Related skills: tsed-di (providers, scopes), tsed-configuration (settings overrides), tsed-controllers, tsed-middlewares, tsed-exceptions (error payload assertions).

© tsedio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/tsed/skills/tsed-testing of tsedio/tsed.

  • SKILL.md
  • agents/openai.yaml
  • references/recipes.md

Open the folder on GitHubat commit cebcc11

Compare with similar skills

Tsed Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tsed Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tsed Testing this skilltsedio/tsed3.1k—~2kAutomated safety check: PassMIT
Designing TestsCloudAI-X/claude-workflow-v21.4k1 repos~1.5kAutomated safety check: PassMIT
Test Behavior Not Implementationfmflurry/settings-opencode171—~736Automated safety check: PassMIT
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Vitestsupabase/supabase111k12 repos~1.1kAutomated safety check: PassApache-2.0
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT

Similar skills

  • Designing Tests

    CloudAI-X/claude-workflow-v2

    Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.

    1.4k GitHub starsUsed in 1 repo~1.5k tokens
    Testing & QAAuto-check passed
  • Test Behavior Not Implementation

    fmflurry/settings-opencode

    A skill your agent uses when writing, reviewing, or keeping a unit/integration test (Jest, Vitest, xUnit).

    171 GitHub stars~736 tokensUpdated today
    Testing & QAAuto-check passed
  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Vitest

    pixel-point/animate-text

    Vitest testing framework patterns for test setup, async testing, mocking with vi., snapshots, and test performance (formerly test-vitest).

    149 GitHub starsUsed in 2 repos~1.3k tokens
    Testing & QAAuto-check passed

More from tsedio/tsed

All 19 skills in this repo
  • Create a production-ready Ts.ED platform adapter for a new HTTP framework or runtime, such as Hono, Elysia, Bun.serve, or a Node framework.

    3.1k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Tsed CLI

    tsedio/tsed

    Scaffolds Ts.ED v8 projects and generates files with the Ts.ED CLI v7, through its MCP server (tools set-workspace, init-project, list-templates, get-template, generate-file) or the tsed binary…

    3.1k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Configure and bootstrap a Ts.ED v8 server - the @Configuration decorator or configuration() on the Server class, PlatformExpress/PlatformKoa/PlatformFastify.bootstrap, server options (mount…

    3.1k GitHub stars~2.1k tokensUpdated today
    Auto-check: notes
  • Tsed Di

    tsedio/tsed

    Declare, inject and scope Ts.ED v8 providers and wire lifecycle hooks - @Injectable, @Module, @Controller, @Inject, the functional API (inject, injectMany, lazyInject, constant, refValue…

    3.1k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Tsed Docs

    tsedio/tsed

    Locates authoritative Ts.ED v8 documentation and API reference instead of guessing framework APIs.

    3.1k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Tsed Logger

    tsedio/tsed

    Configure and use logging in a Ts.ED v8 application with @tsed/logger v8.

    3.1k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Tsed Testing

What does Tsed Testing do?

Write unit and integration tests for Ts.ED v8 applications with Vitest (Jest as a fallback) - vitest.config with unplugin-swc, PlatformTest.create/invoke/reset from @tsed/platform-http/testing…. Tsed Testing is an agent skill from tsedio/tsed.callback().

When should I use Tsed Testing?

Tsed Testing fits situations like: fixing .spec.ts files for services; injected properties are undefined in tests; on the error Platform type is not specified / a missing platform adapter.

How do I install Tsed Testing in Claude Code?

Run `npx skills add tsedio/tsed --skill tsed-testing -a claude-code`. Or copy the skill folder (plugins/tsed/skills/tsed-testing in tsedio/tsed) into .claude/skills/tsed-testing in your project. Claude Code loads it when a task matches its description.

How do I install Tsed Testing in Codex?

Run `npx skills add tsedio/tsed --skill tsed-testing -a codex`. Or copy the skill folder (plugins/tsed/skills/tsed-testing in tsedio/tsed) into .agents/skills/tsed-testing in your project. Codex loads it when a task matches its description.

Can I use Tsed Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tsedio/tsed --skill tsed-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tsed-testing, .gemini/skills/tsed-testing, .github/skills/tsed-testing and .opencode/skills/tsed-testing in your project.

What does Tsed Testing need to run?

Going by SKILL.md and its folder, Tsed Testing needs the command-line tools its instructions call (vitest).

Does Tsed Testing access the network?

SKILL.md names 1 domain. In commands or code: tsed.dev; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Tsed Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tsed Testing use?

Tsed Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tsed Testing use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to Tsed Testing?

Skills that share tags, products or a category with Tsed Testing: Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars), Test Behavior Not Implementation (fmflurry/settings-opencode, 171 stars), Test Writing Workflow (iOfficeAI/AionUi, 33k stars) and Vitest (supabase/supabase, 111k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tsed Testing?

tsedio (a GitHub organization) maintains it in tsedio/tsed, which has 3,088 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 7, 2026.

Source: tsedio/tsed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.