원클릭으로
testing-patterns
TDD workflow and testing patterns
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
TDD workflow and testing patterns
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Git commit conventions and workflow
Guide for breaking features into atomic, implementable tasks
Author safe RalphX Agent Workflow scripts that orchestrate durable delegated agents through the high-level workflow API.
Guide for analyzing git diff and refining QA test plans
Guide for generating QA test steps with agent-browser commands
Narrow RalphX Agent Workspace bridge playbook for workflow events delivered into an existing Agent Workspace conversation.
| name | testing-patterns |
| description | TDD workflow and testing patterns |
| disable-model-invocation | true |
| user-invocable | false |
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
describe('MyComponent', () => {
it('should render the title', () => {
render(<MyComponent title="Hello" />);
expect(screen.getByText('Hello')).toBeInTheDocument();
});
it('should call onChange when clicked', async () => {
const onChange = vi.fn();
render(<MyComponent onChange={onChange} />);
await userEvent.click(screen.getByRole('button'));
expect(onChange).toHaveBeenCalled();
});
});
import { renderHook, act } from '@testing-library/react';
it('should increment counter', () => {
const { result } = renderHook(() => useCounter());
act(() => {
result.current.increment();
});
expect(result.current.count).toBe(1);
});
// Mock Tauri invoke
vi.mock('@tauri-apps/api/core', () => ({
invoke: vi.fn(),
}));
// Mock module
vi.mock('./api', () => ({
fetchData: vi.fn().mockResolvedValue({ data: [] }),
}));
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_addition() {
assert_eq!(add(2, 2), 4);
}
#[test]
#[should_panic(expected = "divide by zero")]
fn test_divide_by_zero() {
divide(1, 0);
}
}
#[tokio::test]
async fn test_async_operation() {
let result = fetch_data().await;
assert!(result.is_ok());
}
// tests/integration.rs
use ralphx_lib::AppState;
#[tokio::test]
async fn test_full_workflow() {
let state = AppState::new_test();
// Test complete workflow
}
Follow the target project's local validation instructions. Select only the affected test file, module, crate, or named test; do not turn these examples into a full-suite completion gate.
# TypeScript
npm run test:run -- <affected-test-file>
# Rust
cargo test <test_or_module_filter> --lib
cargo nextest run --test <affected-suite> -E 'test(<test_or_module_filter>)'