# Write Unit Tests for a Function

Source: https://coremesh.online/prompts/write-unit-tests-for-a-function/

Write unit tests in TypeScript + Vitest for this function:

```
export function slugify(s: string): string {
  return s.toLowerCase().trim().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
}
```

Start with edge cases (emoji, accents, empty string, only symbols), then the normal cases.
Rules: one behaviour per test, descriptive test names, no mocking unless the function has side effects.
If a test would fail with the current code, mark it and explain why in one line instead of changing the expected value.
