Frontend Typescript Testing logo

Frontend Typescript Testing

Community
shinpr
frontend-typescript-testing

Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW, Vitest, and Playwright when present. Use when adding or reviewing component, loading/error-state, integration, or frontend E2E tests.

Overview

Publishershinpr
Repositoryai-coding-project-boilerplate
Skill namefrontend-typescript-testing
Stars
234
Forks
28
Bundled files
1
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.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Frontend Typescript Testing 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/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-en/frontend-typescript-testing
  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/shinpr/ai-coding-project-boilerplate.git /tmp/ai-coding-project-boilerplate
mkdir -p .claude/skills
cp -r /tmp/ai-coding-project-boilerplate/.claude/skills-en/frontend-typescript-testing .claude/skills/frontend-typescript-testing
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Frontend Typescript Testing 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 Frontend Typescript Testing 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 Frontend Typescript Testing 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.

TypeScript Testing Rules (Frontend)

Prerequisite Detection

Inspect package.json, the lockfile, test configuration, and existing test imports before selecting a framework or command. Apply Vitest, React Testing Library, MSW, or Playwright rules only when the dependency/configuration is present. Use the repository's configured equivalent when different. If no runnable harness can be identified, report the inspected paths and the missing framework or command instead of inventing one.

References

Test TypeReferenceWhen to Use
Unit / IntegrationThis documentImplementing React component tests with RTL + Vitest + MSW
E2Ereferences/e2e.mdImplementing browser-level E2E tests with Playwright

Test Framework

  • Vitest: Use when the repository config or existing tests select Vitest
  • React Testing Library: For component testing
  • MSW (Mock Service Worker): For API mocking
  • Test imports: import { describe, it, expect, beforeEach, vi } from 'vitest'
  • Component test imports: import { render, screen } from '@testing-library/react'
  • User interaction: import userEvent from '@testing-library/user-event'
  • Mock creation: Use vi.mock()

Basic Testing Policy

Quality Requirements

  • Regression protection: assert the named acceptance result, public branch, or failure state on critical paths and high-reuse components
  • Independence: Each test can run independently without depending on other tests
  • Reproducibility: Control time, randomness, environment values, network responses, and browser state so identical inputs produce the same observable result
  • Readability: Each test names one user-visible behavior, separates setup/action/assertion, and keeps fixtures limited to values used by that behavior

Where to concentrate test rigor

For shared components, custom hooks, and utilities reused across features, cover their public branches, error states, and boundary contracts because their regression blast radius is wider. Verify page-level composition through integration/E2E tests when the behavior depends on multiple rendered units.

Test Types and Scope

  1. Unit Tests (React Testing Library)

    • Verify behavior of individual components or functions
    • Mock all external dependencies
    • Focus on user-observable behavior
  2. Integration Tests (React Testing Library + MSW)

    • Verify coordination between multiple components
    • Mock APIs with MSW (Mock Service Worker)
    • No actual DB connections (backend manages DB)
    • Verify flows that implement a primary acceptance criterion or coordinate multiple rendered components
  3. Cross-functional Verification

    • When a new feature reaches a shared integration point, continuity of the existing feature becomes a proof obligation if its failure would break a primary user journey or contract, or degrade a secondary observable behavior. Prove it at the cheapest boundary that can expose its failure
    • Verification pattern: Existing feature operation -> Enable new feature -> Verify continuity of existing features
    • Success criteria: Preserve the displayed content and interaction behavior named by the source acceptance criteria; apply a rendering-time threshold only when project configuration or a requirement defines its value and measurement method
    • Designed for automatic execution in CI/CD pipelines

Test Implementation Conventions

Directory Structure and Naming

  • Co-locate a component's test in the component's own directory, so implementation and test move together
  • Test files: {ComponentName}.test.tsx
  • Integration test files: {FeatureName}.integration.test.tsx
  • Test suites: Names describing target components or features
  • Test cases: Names describing expected behavior from user perspective

Test Code Quality Rules

Keep every committed test active. Repair a test that protects current behavior. Remove a test when its behavior is no longer required and the source requirement or implementation contract confirms the removal, or when another retained test fails for every regression the removed test detects.

Mock Type Safety Enforcement

Constrain an MSW handler's response body with satisfies against the domain type it stands for, so a fixture that drifts from the contract fails at compile time rather than producing a passing test against a shape the app never receives.

Type a component or dependency mock to the surface the subject under test actually consumes — Pick<Props, 'usedProp'>, Pick<Router, 'push'> — rather than the full interface, and constrain the literal with satisfies so an extra or misnamed member fails at compile time.

Test Design Patterns

Test user-visible results, not implementation details. Query by the role and accessible name the user perceives (getByRole/getByLabelText/getByText), not getByTestId or container.querySelector. Drive interactions through userEvent with userEvent.setup() per test rather than firing raw events, so the test reproduces the browser's event sequence. await every interaction and async assertion — an unawaited interaction asserts against the pre-update render, so use findBy* for async UI.

Cover empty, error, and loading/async states, not only the happy path. Produce an error state by overriding the MSW handler for that single test rather than changing the shared handler set.

When the required UI state, accessibility name, or external contract is unknown, stop test design for that assertion and name the UI Spec, acceptance criterion, implementation contract, or user decision needed. Continue with independent assertions whose expected behavior is observed.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Frontend Typescript Testing AI skill do?

Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW, Vitest, and Playwright when present. Use when adding or reviewing component, loading/error-state, integration, or frontend E2E tests.

Why use Frontend Typescript Testing on TypingMind?

Because you install it once and use it with any model. Frontend Typescript Testing 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 Frontend Typescript Testing in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-en/frontend-typescript-testing. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Frontend Typescript Testing?

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 Frontend Typescript Testing?

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

Is the Frontend Typescript Testing AI skill free?

Yes. It is published on GitHub by shinpr 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 👇