Toolverse
All skills

g2-unit-testing-skills

by antvis

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.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
antvis
Category
Testing

About this skill

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.

How to use

  1. Zainstaluj skill w swoim środowisku Claude/Copilot, wskazując repozytorium https://github.com/antvis/G2/tree/v5/.claude/skills/g2-testing. Upewnij się, że masz zainstalowane TypeScript i framework testowy Jest.
  2. Zapoznaj się ze strukturą katalogów testów w G2: testy jednostkowe znajdują się w __tests__/unit/ (podzielone na api, data, scale, encode, component, utils), a testy integracyjne w __tests__/plots/ (static, animation, api, interaction, tooltip, legend, bugfix).
  3. Przed napisaniem testów zapoznaj się z kodem modułu, który chcesz testować, oraz strukturą projektu G2.
  4. Gdy potrzebujesz wygenerować test, poproś skill o wytyczne dla konkretnego typu testu (np. test funkcji transformacji danych, test komponentu, test renderowania). Skill dostarczy wzorce i best practices zgodne z dokumentacją G2.
  5. Postępuj zgodnie z wytycznymi dotyczącymi struktury testu, organizacji kodu i konwencji nazewnictwa zawartymi w specyfikacji skill'u.
  6. Uruchom testy za pomocą Jest, aby sprawdzić poprawność implementacji i upewnić się, że testy są spójne z resztą bazy kodu G2.

Related skills