G2

g2-unit-testing-skills

Best practices for writing unit and integration tests for the G2 visualization library.

Install

mkdir -p .claude/skills/g2-unit-testing-skills && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8256" && unzip -o skill.zip -d .claude/skills/g2-unit-testing-skills && rm skill.zip

Installs to .claude/skills/g2-unit-testing-skills

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guidelines and best practices for writing unit tests in the G2 visualization library, covering directory structure, testing patterns, and implementation guidelines. Use when need to generate test.
196 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • →Organize unit tests by module
  • →Implement integration tests for charts
  • →Export chart configurations as G2Spec
  • →Run specific test files or patterns

How it works

The skill provides a directory structure and testing patterns for G2, using Jest for unit tests and screenshot-based integration tests for chart rendering.

Inputs & outputs

You give it
Module or chart specification
You get back
Jest test file or G2Spec configuration

When to use g2-unit-testing-skills

  • →Write G2 data transformation tests
  • →Generate unit tests for G2 components
  • →Create visual integration tests for charts
  • →Test chart API modules

About g2-unit-testing-skills

Provides structure and guidelines for testing pure data modules, API interactions, and rendering results in the G2 library. It includes details on unit test organization and visual integration testing patterns.

Guidelines and best practices for writing unit tests in the G2 visualization library, covering directory structure, testing patterns, and implementation guidelines. Use when need to generate test.

When not to use it

  • →When testing code outside the G2 visualization library

Prerequisites

TypeScriptJest

Limitations

  • →Requires familiarity with G2 codebase structure

How it compares

It enforces a specific G2-compatible structure and export convention for chart tests compared to generic unit testing.

Compared to similar skills

g2-unit-testing-skills side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
g2-unit-testing-skills (this skill)09moReviewIntermediate
dependency-upgrade266moReviewIntermediate
angular-best-practices215moNo flagsAdvanced
validate-typescript511moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry