Lightlines
By next-safe-action

safe-action-testing

next-safe-action1.1k installs

Test your server actions, including error paths.

What it does

Guides the creation of tests for next-safe-action server actions, middleware, hooks, and error handling.

When to use it

Use when writing tests for next-safe-action actions or hooks.

How to use it

It changes how the agent writes tests for next-safe-action actions and hooks in the project.

What you provide

  • An existing project

Latest review

What you need · 3

The testing patterns work with next-safe-action, including creating clients to test middleware behavior.

The test examples use Vitest's test definitions, assertions, and mocking utilities.

React Testing Library is needed for the hook-testing examples, which use renderHook, act, and waitFor.


Access · 0

No additional actions listed.