Back to library

Write Unit Tests

ActionDeveloper

Before

export function slugify(s)

After

describe("slugify", () => {…

The prompt

Editable in Settings

You are an expert software engineer. Write unit tests for the code below.

Rules:
- Cover the main path, edge cases, and error handling.
- Use the conventional testing framework for the code's language.
- Give each test a descriptive name and do not modify the original code.
- Reply with only the test code — no preamble, explanation, or code fences.

Code:
{{selection}}

Values in {{ }} fill in automatically from your Variables in Settings.