Typescript Tests logo

Typescript Tests

Community
mkosir
typescript-tests

Apply, review, and explain testing conventions from the TypeScript Style Guide. Use automatically for TypeScript and TSX test tasks involving test design, AAA, mocking, isolation, black-box testing, Testing Library queries, test descriptions, or snapshots.

Overview

Publishermkosir
Repositorytypescript-style-guide
Skill nametypescript-tests
Stars
783
Forks
37
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by mkosir on GitHub. Read the source before you install it.

Installation

Install the Typescript Tests AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/mkosir/typescript-style-guide/tree/main/skills/typescript-tests
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mkosir/typescript-style-guide.git /tmp/typescript-style-guide
mkdir -p .claude/skills
cp -r /tmp/typescript-style-guide/skills/typescript-tests .claude/skills/typescript-tests
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Typescript Tests in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Typescript Tests on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Typescript Tests is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Tests

Apply the TypeScript Style Guide's testing conventions in the context of the current task.

Workflow

  1. Inspect the consuming repository's test runner, libraries, conventions, and configuration.
  2. Let explicit repository conventions take precedence over this opinionated guidance.
  3. Apply, review, or explain only the guidance relevant to the task.
  4. State important tradeoffs when testing strategy depends on risk, scope, or maintenance cost.

Boundaries

  • Keep the test runner, TypeScript, and ESLint responsible for checks they can enforce automatically.
  • Do not add or rewrite unrelated tests merely because this skill is active.

Related Guidance

Functions

For detailed function design guidance that supports testability, use typescript-functions when it is available.

Appendix - Tests

What & How To Test

Automated tests help us write better code, make refactoring easier, and catch bugs earlier in the process.
Consider the trade-offs of what and how to test to gain confidence that the application is working as intended, while ensuring that writing and maintaining tests doesn't slow the team down.

✅ Do:

  • Keep tests short, explicit, and pleasant to work with. A test's intent should be immediately visible.
  • Strive to follow the AAA pattern to maintain clean, organized, and understandable unit tests.
    • Arrange - Setup preconditions or the initial state necessary for the test case. Create necessary objects and define input values.
    • Act - Perform the action you want to unit test (invoke a method, triggering an event etc.). Strive for minimal number of actions.
    • Assert - Validate the outcome against expectations. Strive for minimal number of asserts.
      The rule "unit tests should fail for exactly one reason" doesn't always need to apply, but tests with many assertions can indicate a code smell.
  • As mentioned in function conventions, try to keep functions pure and impure ones small and focused.
    This makes them easy to test by passing arguments and observing return values, since we will rarely need to mock dependencies.
  • Strive to write tests based on how a user interacts with your app, meaning test business logic.
    E.g. for a specific user role or permission, given some input, we receive the expected output from the process.
  • Make tests as isolated as possible so they don't depend on execution order and can run independently with their own local storage, session storage, data, cookies etc. Test isolation speeds up the test run, improves reproducibility, makes debugging easier and prevents cascading test failures.
  • Tests should be resilient to changes.
    • Black box testing - Always test only publicly exposed behavior. Don't write fragile tests based on how the implementation works internally.
    • Query HTML elements based on attributes that are unlikely to change. Order of priority must be followed as specified in Testing Library - role, label, placeholder, text contents, display value, alt text, title, test ID.
    • If testing with a database, make sure you control the data. If tests are run against a staging environment, make sure it doesn't change.

❌ Don't:

  • Don't test implementation details. When refactoring code, tests shouldn't change.
  • Don't re-test the library/framework.
  • Don't mandate 100% code coverage for applications.
  • Don't test third-party dependencies. Only test what your team controls (package, API, microservice etc.). Don't test external site links, third-party servers, packages etc.
  • Don't test just to test. Every test should provide meaningful confidence.

Test Description

All test descriptions must follow the naming convention it('should ... when ...').

ts
// ❌ Avoid
it('accepts ISO date format where date is parsed and formatted as YYYY-MM');
it('after title is confirmed user description is rendered');

// ✅ Name test description as it('should ... when ...')
it('should return parsed date as YYYY-MM when input is in ISO date format');
it('should render user description when title is confirmed');

Snapshot

Snapshot tests are discouraged to avoid fragility, which leads to a "just update it" mindset to make all tests pass.
Exceptions can be made with strong rationale when the snapshot is short and clearly communicates what's being tested (e.g., critical design system library elements that shouldn't deviate).

Frequently asked questions

What does the Typescript Tests AI skill do?

Apply, review, and explain testing conventions from the TypeScript Style Guide. Use automatically for TypeScript and TSX test tasks involving test design, AAA, mocking, isolation, black-box testing, Testing Library queries, test descriptions, or snapshots.

Why use Typescript Tests on TypingMind?

Because you install it once and use it with any model. Typescript Tests is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Typescript Tests in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mkosir/typescript-style-guide/tree/main/skills/typescript-tests. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Typescript Tests?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Typescript Tests?

As many as you like. As long as a model supports skills, you can use Typescript Tests with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Typescript Tests AI skill free?

Yes. It is published on GitHub by mkosir under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇