Codex xterm.js addon unit tests
Write or review TypeScript tests for xterm.js addons. Use a real terminal instance and verify addon behavior with clear assertions.
中文Install in Codex
Codex with an xterm.js TypeScript test checkout and a real Terminal instance.
- Review `.agents/skills/unit-test/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.agents/skills/unit-test/` in your project and save the reviewed file as `.agents/skills/unit-test/SKILL.md`.
- Start Codex from that project's root, then type `$unit-test` and select the matching skill.
Example task
Check whether addon loading passes the current terminal. This sample addon's activate method saves its argument as received.
{"id":"addon-demo","terminal":"Terminal","initialReceived":null,"call":"loadAddon"}What to check
The `received` field of `addon-demo` references the same real `Terminal`. Expect `assert.strictEqual(addon.received, terminal)` to pass.
Original SKILL.md on GitHub · Updated
Frequently asked question
Can I mock the terminal when testing xterm.js addon initialization?
The project's test convention calls for a real terminal instance. Check the instance or addon state after loading.