/react-19:testing-server-actionsfrom react-19
Teaches testing Server Actions in isolation in React 19. Use when testing Server Actions, form handling, or server-side logic.
Ships in react-19. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
For Vitest mocking patterns (vi.mock(), vi.fn(), mockResolvedValue), see vitest-4/skills/writing-vitest-tests/SKILL.md.
import { submitContact } from './actions';
test('submitContact validates email', async () => {
const formData = new FormData();
formData.set('email', 'invalid');
formData.set('message', 'Hello');
const result = await submitContact(null, formData);
expect(result.error).toBeTruthy();
});
test('submitContact succeeds with valid data', async () => {
const formData = new FormData();
formData.set('email', '[email protected]');
formData.set('message', 'Hello');
const result = await submitContact(null, formData);
expect(result.success).toBe(true);
});
import { createUser } from './actions';
import { db } from './db';
vi.mock('./db', () => ({
db: {
users: {
create: vi.fn(),
},
},
}));
test('createUser creates database record', async () => {
db.users.create.mockResolvedValue({ id: '123', name: 'Alice' });
const formData = new FormData();
formData.set('name', 'Alice');
formData.set('email', '[email protected]');
const result = await createUser(null, formData);
expect(db.users.create).toHaveBeenCalledWith({
name: 'Alice',
email: '[email protected]',
});
expect(result.success).toBe(true);
expect(result.userId).toBe('123');
});
import { deletePost } from './actions';
import { getSession } from './auth';
vi.mock('./auth');
test('deletePost requires authentication', async () => {
getSession.mockResolvedValue(null);
await expect(deletePost('post-123')).rejects.toThrow('Unauthorized');
});
test('deletePost checks ownership', async () => {
getSession.mockResolvedValue({ user: { id: 'user-1' } });
await expect(deletePost('post-owned-by-user-2')).rejects.toThrow('Forbidden');
});
For comprehensive Server Action testing, test the function directly in isolation.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub djankies/claude-configs --plugin react-1926 skills in this plugin
/composing-componentsTeaches component composition patterns in React 19 including children prop, compound components, and render props. Use when designing component APIs, creating reusable components, or avoiding prop drilling./following-the-rules-of-hooksFix React Rules of Hooks violations - conditional calls, hooks in loops/callbacks/classes/implementing-code-splittingTeaches code splitting with lazy() and Suspense in React 19 for reducing initial bundle size. Use when implementing lazy loading, route-based splitting, or optimizing performance.Other plugins' skills for the same job