#554·openui

Add unit tests for OpenUI CLI helper functions

Author: vishxradCreated May 24, 2026Updated Aug 26, 2026
Labelsenhancementgood first issuehelp wanted

Summary

packages/openui-cli has useful isolated helper functions but no test coverage. Adding small unit tests here would improve confidence in CLI behavior without needing to exercise the full scaffolding flow.

Good initial targets

  • packages/openui-cli/src/lib/detect-package-manager.ts
  • packages/openui-cli/src/lib/resolve-args.ts

Suggested implementation

Add a Vitest setup for the CLI package and cover cases such as:

  • detectPackageManager() returns pnpm dlx, yarn dlx, bunx, or npx based on npm_config_user_agent
  • resolveArgs() returns provided values without prompting
  • resolveArgs() handles non-interactive missing required args predictably

Acceptance criteria

  • The CLI package has a working test script.
  • Helper tests are deterministic and do not require real interactive input.
  • Existing build/lint scripts continue to work.