gpui-testing

Test GPUI applications using TestAppContext and the #[gpui::test] attribute.

27|3|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/cnwzhu/gpui-skills --skill gpui-testing
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gpui-testing
Source: https://github.com/cnwzhu/gpui-skills/tree/main/gpui-testing
Command: npx skills add https://github.com/cnwzhu/gpui-skills --skill gpui-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of testing GPUI applications and components, providing a structured approach to writing, running, and validating tests in a GPUI environment.

Core Features & Use Cases

  • Test harness support: Use TestAppContext to set up and isolate test scenarios for GPUI apps.
  • Async testing: Execute asynchronous tasks and verify outcomes using the GPUI test utilities.
  • User input simulation: Simulate clicks and key presses to validate interactions.
  • Entity testing patterns: Create and interact with test entities to assert lifecycle and state changes.
  • Use Case: Example: test a counter component by creating a TestAppContext, updating state, and asserting the expected value.

Quick Start

Write and run a GPUI test using the gpui::test attribute and a TestAppContext fixture.

Frequently Asked Questions about gpui-testing

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

FAQPage Schema
How do I test GPUI components in Rust?▼

To test GPUI components in Rust, use the #[gpui::test] attribute and a TestAppContext fixture to set up isolated test scenarios and verify component state and interactions.

What is the best way to simulate user input in GPUI tests?▼

The best way to simulate user input in GPUI tests is by utilizing the TestAppContext to simulate clicks and key presses, allowing you to validate component interactions accurately.

Can I test async operations using GPUI test utilities?▼

Yes, you can test async operations using GPUI test utilities by executing asynchronous tasks within the TestAppContext and verifying the outcomes with the provided test harness.

Do I need additional dependencies to run async tests for GPUI apps?▼

No additional dependencies are required; you only need standard Rust tooling and GPUI's built-in test utilities to run async tests and manage entity lifecycles.

How do I assert entity lifecycle changes in a GPUI test?▼

To assert entity lifecycle changes in a GPUI test, create and interact with test entities via the TestAppContext to verify state changes and expected lifecycle behavior.