testing

Test Graph Explorer with Vitest, Jotai state, and data factories.

476|102|Updated Oct 26, 2022
One-click install
npx skills add https://github.com/aws/graph-explorer --skill testing-aws
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/aws/graph-explorer/tree/main/.kiro/skills/testing
Command: npx skills add https://github.com/aws/graph-explorer --skill testing-aws

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and utilities for testing the Graph Explorer application, ensuring code quality, reliability, and backward compatibility.

Core Features & Use Cases

  • Testing Standards: Outlines best practices for writing unit and integration tests using Vitest.
  • Test Utilities: Introduces helpers like DbState, createTestableVertex, and renderHookWithState for efficient test setup and execution.
  • Backward Compatibility: Details strategies for testing persisted data to ensure compatibility with older data shapes.
  • Use Case: A developer needs to add a new feature to Graph Explorer. This Skill guides them on how to write effective tests for their new code, ensuring it integrates seamlessly and doesn't break existing functionality, especially concerning how user preferences are stored and loaded.

Quick Start

Refer to the testing skill for detailed instructions on setting up and running tests within the Graph Explorer project.

Frequently Asked Questions about testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration tests for Graph Explorer using Vitest?

Vitest integration tests for Graph Explorer should follow established testing standards, utilizing provided utilities like `renderHookWithState` and `DbState` to ensure reliable component and state integration validation.

What is the best way to test backward compatibility for persisted data in Graph Explorer?

Backward compatibility testing for persisted data validates compatibility with older data shapes, ensuring that updates to user preference storage and loading mechanisms do not break existing Graph Explorer functionality.

How does Jotai state management work within Graph Explorer test utilities?

Jotai state management in tests uses helpers like `DbState` and `renderHookWithState` to initialize and manipulate application state, allowing developers to verify component behavior under controlled conditions.

Can I use SPARQL helpers for integration testing in Graph Explorer?

Yes, SPARQL helpers are included in the testing framework to assist with integration testing, enabling developers to validate data queries and interactions within the Graph Explorer application reliably.

What are the limitations of using data factories in Graph Explorer testing?

Data factories like `createTestableVertex` generate mock data for unit tests, but developers must ensure the generated data accurately reflects production schemas to avoid false positives during integration testing.

Do I need Vitest to test persistent storage validation in Graph Explorer?

Vitest is the standard framework for testing persistent storage validation in Graph Explorer, providing the necessary environment to run unit and integration tests that verify data persistence and backward compatibility.