# Unit Test

> Unit Test is an Agent Skill for testing & quality published in the xtermjs/xterm.js repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Write and review xterm.js unit tests with project conventions. Use when editing `*.test.ts` files or when asked for test authoring guidelines.

- Skill name: `unit-test`
- Category: [Testing & Quality](https://www.openparable.com/skill/testing-quality/1)
- Source: https://github.com/xtermjs/xterm.js/blob/HEAD/.agents/skills/unit-test/SKILL.md
- Repository: xtermjs/xterm.js (20,908 GitHub stars when collected)

## SKILL.md

# Unit Test Instructions

When writing unit tests, follow these rules:

- When writing unit tests for addons, always create a real xterm.js instance instead of mocking it.
- Prefer `assert.ok` over `assert.notStrictEqual` when checking something is undefined or not.
- Avoid comments as most tests should be self-documenting.

---

Source: https://www.openparable.com/skill/testing-quality/unit-test (OpenParable). Cite the canonical URL above.
