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.zipInstalls 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.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
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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| g2-unit-testing-skills (this skill) | 0 | 9mo | Review | Intermediate |
| dependency-upgrade | 26 | 6mo | Review | Intermediate |
| angular-best-practices | 21 | 5mo | No flags | Advanced |
| validate-typescript | 5 | 11mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by antvis
View all by antvis →You might also like
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
angular-best-practices
sickn33
Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.
validate-typescript
BerryKuipers
Run TypeScript compiler type-checking (tsc --noEmit) to validate type safety and catch type errors. Works with any TypeScript project. Returns structured output with error counts, categories (type/syntax/import errors), and affected files. Used for quality gates and pre-commit validation.
ts-testing
johnlindquist
Design, implement, and maintain high‑value TypeScript test suites using popular JS/TS testing libraries. Use this skill whenever the user is adding tests, debugging failing tests, or refactoring code that should be covered by tests.
react-best-practices
redpanda-data
Client-side React performance optimization patterns.
feature-flags
Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.