Skip to content

Add unit tests for OpenUI CLI helper functions #554

@vishxrad

Description

@vishxrad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions