基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/DataDog/datadog-ci --skill write-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | write-tests |
| description | Write tests for datadog-ci commands and helpers using established repository patterns. |
Write tests for datadog-ci commands and helpers following the repo's established patterns. Before writing tests, read existing tests in the same package to match local patterns.
__tests__/*.test.ts next to the source, fixtures in __tests__/fixtures/From packages/base/src/helpers/__tests__/testing-tools.ts:
createMockContext(opts?) -- creates a mock context with stdout and stderr writable streams. Use context.stdout.toString() / context.stderr.toString() to check output.makeRunCLI(commandClass, baseArgs, opts?) -- returns an async function (extraArgs, extraEnv?) => {context, code} that registers and runs a command through the full CLI pipeline.createCommand(commandClass, context?) -- instantiates a command with mock context and resolved option defaults. Good for unit-testing command methods directly.MOCK_DATADOG_API_KEY, MOCK_BASE_URL -- standard mock values.getRequestError(status, {errors?, message?}) -- creates a mock RequestError.jest.spyOn() for mocking, restore in afterEach or use jest.restoreAllMocks()jest.mock() for module-level mocks when neededdescribe.each / test.each where appropriatefetch)yarn test # all tests
yarn test <path> # specific package or file
yarn test --testPathPattern # regex match