safe-action-testing

Installation
SKILL.md

Testing next-safe-action

Testing Actions Directly

Server actions are async functions — call them directly in tests:

// src/__tests__/actions.test.ts
import { describe, it, expect, vi } from "vitest";
import { createUser } from "@/app/actions";

describe("createUser", () => {
  it("returns user data on valid input", async () => {
    const result = await createUser({ name: "Alice", email: "alice@example.com" });
Related skills

More from next-safe-action/skills

Installs
533
First Seen
Mar 6, 2026