Skip to content

[Bug]: required option values can be silently ignored for dot-notation CLI flags #1059

@fi3ework

Description

@fi3ework

Version

System:
  OS: macOS 15.0.1
  CPU: (14) arm64 Apple M3 Max
  Memory: 119.70 MB / 36.00 GB
  Shell: 5.9 - /bin/zsh
Browsers:
  Chrome: 146.0.7680.72
  Safari: 18.0.1
npmPackages:
  @rstest/core: workspace:* => 0.9.2
  @rstest/coverage-istanbul: workspace:* => 0.3.0

Details

Running required dot-notation CLI options without a value does not report a usage error.

For example, these commands currently continue instead of failing:

pnpm rstest --pool.type
pnpm rstest --pool.maxWorkers

Expected behavior:

  • --pool.type should report that <type> is missing
  • --pool.maxWorkers should report that <value> is missing

Actual behavior:

  • no missing-value error is reported

Suspected cause:

  • this likely comes from cac handling of required options with dot notation (--foo.bar <value>), rather than rstest-only logic
  • it may also affect similar options such as --pool.minWorkers, --pool.execArgv, --browser.name, and --browser.port

Reproduce link

https://github.com/web-infra-dev/rstest/tree/main/examples/node

Reproduce Steps

  1. clone web-infra-dev/rstest
  2. run pnpm install
  3. run pnpm rstest --pool.type
  4. run pnpm rstest --pool.maxWorkers
  5. observe that rstest does not report a missing required value error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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