跳转到主要内容
此内容尚未提供您的语言版本,正在以英文显示。

Test Cli Application

技能 已验证 活跃

Write integration tests for a Node.js CLI application using the built-in node:test module. Covers the exec helper pattern, output assertions, filesystem state verification, cleanup hooks, JSON output parsing, error case testing, and state restoration after destructive tests. Use when adding tests to an existing CLI, testing a new command, verifying adapter behavior across frameworks, or setting up CI for a CLI tool.

目的

To enable developers to write robust integration tests for their Node.js CLI applications, ensuring correctness and preventing regressions.

功能

  • Integration testing for Node.js CLIs
  • Utilizes built-in `node:test` module
  • Covers `execSync` helper pattern
  • Verifies output assertions and filesystem state
  • Includes cleanup hooks and error case testing

使用场景

  • Adding tests to an existing CLI
  • Testing a new CLI command
  • Verifying adapter behavior
  • Setting up CI for CLI tools

非目标

  • Unit testing internal functions directly
  • End-to-end testing of full application workflows beyond CLI interaction

安装

/plugin install agent-almanac@pjt222-agent-almanac

质量评分

已验证
99 /100
about 22 hours ago 分析

信任信号

最近提交2 days ago
星标14
许可证MIT
状态
查看源代码