- name
SKILL.md
ไฟล์สกิลยังคงอยู่ในรีโพซิทอรีของผู้เผยแพร่
วางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Doist/todoist-cli --skill write-tests -a cursor -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Doist/todoist-cli --skill write-tests -a claude-code -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Doist/todoist-cli --skill write-tests -a codex -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add Doist/todoist-cli --skill write-tests -a grok -yส่งข้อความที่คัดลอกไว้ในแชต Grok Bot แล้ว Bot จะดึง SKILL.md นี้จาก GitHub และเพิ่มลงในสกิลที่ Bot ทุกตัวของคุณใช้ร่วมกัน
Install this skill: https://github.com/Doist/todoist-cli/tree/HEAD/.agents/skills/write-testsจากผู้เผยแพร่
src/lib/refs.ts → src/lib/refs.test.ts. A command group has one test file for the group or one per subcommand (src/commands/label/label.test.ts, src/commands/project/reorder.test.ts). Vitest, globals on, restoreMocks: true, so spies restore themselves: no manual .mockRestore().vi.mock('../../lib/api/core.js', () => ({ getApi: vi.fn() })) at the top, mockApi = setupApiMock() in beforeEach, a program from createTestProgram(registerXxxCommand), then program.parseAsync(['node', 'td', ...]). Capture output with captureConsole() or captureStream(). Read src/commands/label/label.test.ts for the shape.src/index.integration.test.ts builds the CLI and runs dist/index.js, for argv handling, global flags and JSON errors end to end.vi.mock('chalk') uses the manual mock in src/__mocks__/chalk.ts, which makes styling a passthrough so tests read plain text..agents/scripts/ and run copies of the tools in throwaway repos (.agents/scripts/lib/test-repo.ts).From src/test-support/: createMockApi, setupApiMock, fixtures, makeFilter, createProjectProgram. From @doist/cli-core/testing: createTestProgram, captureConsole, captureStream, describeEmptyMachineOutput. Build entities from fixtures instead of by hand; extend it when a test needs a new shape.
Read references/test-rules.md before writing or reviewing a test. In short: a test counts only if it can fail. It asserts outcomes, takes expected values from outside the code under test, mocks only real boundaries, and you saw it fail once.
Done when each new test has failed once for the right reason, and then passes.
.skip, no deleted test, no looser matcher (toEqual → toMatchObject, exact arguments → toHaveBeenCalled()).Writes or changes tests in this repository to its quality bar, with the right helpers and layer. Use when adding, fixing or reviewing tests, when a change "needs a test", or when deciding whether a te
---name: write-testsdescription: Writes or changes tests in this repository to its quality bar, with the right helpers and layer. Use when…---# .agents/skills/write-tests/SKILL.mdภาพรวม
Writes or changes tests in this repository to its quality bar, with the right helpers and layer. Use when adding, fixing or reviewing tests, when a change "needs a test", or when deciding whether a test may change.
FAQ
ดาวน์โหลด .agents/skills/write-tests/SKILL.md จากผู้เผยแพร่ หรือคัดลอกพาธแล้วเปิดรีโพซิทอรี PlugMCP แสดงรายการสกิลเท่านั้น ไม่ได้โฮสต์ไฟล์
ผู้เผยแพร่เก็บไว้ที่ https://github.com/Doist/todoist-cli
Claude, Cursor, Codex และ Grok Build อ่าน SKILL.md ที่คุณเพิ่มจากรีโพซิทอรีของผู้เผยแพร่ได้ ส่วน Grok Bot จะติดตั้งให้เมื่อคุณส่งลิงก์โฟลเดอร์ GitHub ของสกิลในแชต