Skip to content

nono.test.ts: the 'falls back when nono not on PATH' fixture links /usr/bin/echo, which macOS does not have #862

Open

Description

@tps-flint

runCommandUnderNono() > warns and falls back when nono not on PATH (non-strict) in packages/cli/test/nono.test.ts builds a private PATH directory and symlinks /usr/bin/echo into it. macOS has no /usr/bin/echo (echo is /bin/echo), so the symlink dangles, the fallback command cannot run, and the test fails on every macOS host regardless of the code under test (seen on rockit with and without cli#850's change). The try { symlinkSync(...) } catch {} hides the cause.

What the fix does:

  1. The fixture links the echo the host actually has (resolve it with command -v echo against the real PATH before replacing PATH, or use process.execPath with a tiny script instead of echo), and fails the test with a named message if no echo can be found instead of swallowing the error.
  2. The test passes on macOS and Linux; CI's existing Linux lane keeps covering it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions