원클릭으로
gpui-test
Writing tests for GPUI applications. Use when testing components, async operations, or UI behavior.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Writing tests for GPUI applications. Use when testing components, async operations, or UI behavior.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | gpui-test |
| description | Writing tests for GPUI applications. Use when testing components, async operations, or UI behavior. |
GPUI provides a comprehensive testing framework that allows you to test UI components, async operations, and distributed systems. Tests run on a single-threaded executor that provides deterministic execution and the ability to test complex async scenarios. GPUI tests use the #[gpui::test] attribute and work with TestAppContext for basic testing and VisualTestContext for window-dependent tests.
[gpui::test] and TestAppContext, just write simple rust test.#[gpui::test]
fn my_test(cx: &mut TestAppContext) {
// Test implementation
}
#[gpui::test]
async fn my_async_test(cx: &mut TestAppContext) {
// Async test implementation
}
#[gpui::test(iterations = 10)]
fn my_property_test(cx: &mut TestAppContext, mut rng: StdRng) {
// Property testing with random data
}
TestAppContext provides access to GPUI's core functionality without windows:
#[gpui::test]
fn test_entity_operations(cx: &mut TestAppContext) {
// Create entities
let entity = cx.new(|cx| MyComponent::new(cx));
// Update entities
entity.update(cx, |component, cx| {
component.value = 42;
cx.notify();
});
// Read entities
let value = entity.read_with(cx, |component, _| component.value);
assert_eq!(value, 42);
}
VisualTestContext extends TestAppContext with window support:
#[gpui::test]
fn test_with_window(cx: &mut TestAppContext) {
// Create window with component
let window = cx.update(|cx| {
cx.open_window(Default::default(), |_, cx| {
cx.new(|cx| MyComponent::new(cx))
}).unwrap()
});
// Convert to visual context
let mut cx = VisualTestContext::from_window(window.into(), cx);
// Access window and component
let component = window.root(&mut cx).unwrap();
}
Repository contribution workflow. Use for any code change that should become a commit — adding features, fixing bugs, refactoring, or any source modification. Drives the full Issue → Branch → PR → Merge process.
Layout and styling in GPUI. Use when styling components, layout systems, or CSS-like properties.
Performance optimization techniques for GPUI including rendering optimization, layout performance, memory management, and profiling strategies. Use when user needs to optimize GPUI application performance or debug performance issues.
GPUI Component project style guide based on gpui-component code patterns. Use when writing new components, reviewing code, or ensuring consistency with existing gpui-component implementations. Covers component structure, trait implementations, naming conventions, and API patterns observed in the actual codebase.
GPUI styling system including theme design, responsive layouts, visual design patterns, and style composition. Use when user needs help with styling, theming, or visual design in GPUI.
Common GPUI patterns including component composition, state management strategies, event handling, and action dispatching. Use when user needs guidance on GPUI patterns, component design, or state management approaches.