Skip to content

Test: 'admin revert --list' nonexistent dataset error not matched in output #368

Closed

Description

@neuromechanist

Failing test

test/cli.test.ts:692 — CLI Admin Revert > nemar admin revert with nonexistent dataset shows error

const { stdout, stderr, exitCode } = await runCli(
  ["admin", "revert", "nm999999", "--list"],
  ctx,
);

const output = (stdout + stderr).toLowerCase();
expect(output.includes("not found") || output.includes("prerequisites")).toBe(true);

The CLI does print ✖ Dataset not found (visible in test output), but the assertion still fails. Possible causes:

  • The string is being written through a stream the test harness's runCli doesn't capture.
  • The unicode prefix or ANSI escape codes are interfering with the .toLowerCase() / .includes() check.
  • --list mode short-circuits before the error path runs.

Needs investigation to determine the exact path that emits the message.

Repro

cd backend
bun test test/cli.test.ts -t "admin revert with nonexistent"

Discovered while working on #340.

Activity

  1. added
    bug
    testing
    cli
    on Apr 27, 2026
  2. neuromechanist commented on May 14, 2026

    @neuromechanist
    ContributorAuthor

    Closing as duplicate of #452 (P1: 4 failing tests + add CI gate), which explicitly tracks this test.

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

    bugclitesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions