SM

studentofjs/mcp-frontend-testing

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

26 stars 8 forks 品質 45 トレンド 11MIT

モデルコンテキストプロトコルのフロントエンドテストツール

概要

このMCPサーバーは、次のようなフロントエンドテスト用のツールを提供しています。 - : 適切なテスト戦略を決定するために JavaScript/TypeScript コードを分析します。 - : Jest と Cypress のユニットとコンポーネントのテストを生成します。 - : Jest と Cypress を使用してテストを実行し、結果を返します。 - : React コンポーネントをテストするために特にツールを提供します。 1. \gitクローンmcp-frontend-testing\ 2. \cd mcp-frontend-testing\ 3.\npmインストール\ - : コードを分析し、分析結果を返します。 - : - \code\(文字列、必須): 解析するソースコード。 - \language\(enum、オプション): コードの言語(\javascript\ \typescript\ \jsx\ \tsx\、デフォルト:\javascript)。 - :ソースコードとフレームワークに基づいてテストコードを生成します。 - : - \code\(文字列、必須): テストを生成するソースコードです。 - \framework\(enum、必須):テストフレームワーク(\jest\ \cypress)。 - \type\(enum, Required): タイプのテスト(\unit\ | \component\ | \e2e).

概要(AI 翻訳)

説明

このMCPサーバーは、次のようなフロントエンドテスト用のツールを提供しています。

  • コード分析:適切なテスト戦略を決定するためにJavaScript/TypeScriptコードを分析します。
  • テスト生成:JestとCypressのユニットとコンポーネントのテストを生成します。 -Test Run:JestとCypressを使用してテストを実行し、結果を返します。 -Component Testing: React コンポーネントをテストするために特にツールを提供します。

はじめる

インストール

  1. リポジトリのクローン: `git clone mcp-frontend-testing` 2.プロジェクトディレクトリへナビゲート: `cd mcp-frontend-testing` 3.依存関係のインストール: [npm install\

サーバーの実行

HTTP トランスポート

[[T3]`バッシュ

サーバーの構築

npm ビルドを実行

HTTP トランスポートでサーバーを起動する

npm 実行開始:http [[T4]`

####Stdioトランスポート

[[T5]`バッシュ

サーバーの構築

npm ビルドを実行

Stdioトランスポートでサーバーを起動する

npm 実行開始:stdio [[T6]`

使用法

ツール

  • analyzeCode: 解析コードと解析結果を返します。 -パラメータ:
  • `code`(文字列、必要): 解析するソースコード.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

MCP Frontend Testing Server

Description

This MCP server provides tools for frontend testing, including:

  • Code Analysis: Analyzes JavaScript/TypeScript code to determine appropriate testing strategies.
  • Test Generation: Generates unit and component tests for Jest and Cypress.
  • Test Running: Executes tests using Jest and Cypress and returns results.
  • Component Testing: Provides a tool specifically for testing React components.

Getting Started

Installation

  1. Clone the repository: `git clone mcp-frontend-testing`
  2. Navigate to the project directory: `cd mcp-frontend-testing`
  3. Install dependencies: `npm install`

Running the Server

HTTP Transport

```bash

Build the server

npm run build

Start the server with HTTP transport

npm run start:http ```

Stdio Transport

```bash

Build the server

npm run build

Start the server with Stdio transport

npm run start:stdio ```

Usage

Tools

  • analyzeCode: Analyzes code and returns analysis results.
    • Parameters:
      • `code` (string, required): The source code to analyze.
      • `language` (enum, optional): Language of the code (`javascript` | `typescript` | `jsx` | `tsx`, default: `javascript`).
  • generateTest: Generates test code based on source code and framework.
    • Parameters:
      • `code` (string, required): The source code to generate tests for.
      • `framework` (enum, required): Testing framework (`jest` | `cypress`).
      • `type` (enum, required): Type of test (`unit` | `component` | `e2e`).
      • `language` (enum, optional): Language of the code (`javascript` | `typescript` | `jsx` | `tsx`, default: `javascript`).
      • `description` (string, optional): Description of the test case.
  • runTest: Runs tests and returns results.
    • Parameters:
      • `sourceCode` (string, required): The source code being tested.
      • `testCode` (string, required): The test code to execute.
      • `framework` (enum, required): Testing framework (`jest` | `cypress`).
      • `type` (enum, required): Type of test (`unit` | `component` | `e2e`).
      • `config` (record, optional): Configuration object for test execution.
  • testReactComponent: Runs component tests specifically for React components.
    • Parameters:
      • `componentCode` (string, required): The source code of the React component.
      • `testCode` (string, optional): Test code for the component (auto-generated if not provided).
      • `framework` (enum, optional): Testing framework (`jest` | `cypress`, default: `jest`).
      • `props` (record, optional): Props to pass to the component during testing.
GitHub で README 全文を見る

インストール

docker run -p 3000:3000 mcp-frontend-testing
MCP 初心者?mcpskill.org のガイドから始めましょう →