Skip to content

test(cli): auto's transcribe child gets the clip and --dir as the transcribe command reads them - #9299

Queued
WaterrrForever wants to merge 1 commit into
mainfrom
miao/cli-auto-transcribe-args
Queued

WaterrrForever wants to merge 1 commit into
mainfrom
miao/cli-auto-transcribe-args

Conversation

@WaterrrForever

Copy link
Copy Markdown
Collaborator

What

A test for how auto starts hyperframes transcribe. #9293 made auto pass --dir <its own folder>, and the only test of that ran a stand-in transcribe callback. Nothing checked the command line the child actually gets.

work-transcribe.test.ts points useCli at a small child script that records its argv and cwd. It runs the real transcribe from work.ts, then reads that argv with the transcribe command's own argument definitions (assertKnownFlags, then citty's parseArgs). It asserts:

  • input is the clip,
  • dir is the folder given,
  • the cwd is the project.

transcribe in work.ts is now exported so the test can call it. Nothing else changes.

Checked

The test fails if the child gets ["transcribe", clip] (no --dir), --directory instead of --dir, or --dir without the clip. It passes as merged. vitest run src/auto: all pass.

🤖 Generated with Claude Code

…nscribe command reads them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at a50cbcd (base main). One commit: a new work-transcribe.test.ts, and transcribe in work.ts is now exported. Nothing else in the code changes.

What holds

  • The test runs the real argument path. It points useCli at a tiny child script that records its argv and cwd, calls the exported transcribe(project, clip, into), then parses the recorded args with the transcribe command's own parseArgs definition and assertKnownFlags. So it checks what the real command would read, not a copy of the argument list.
  • It covers the gap it was written for. The test passes (1/1), and I broke the wiring four ways. Each one fails it:
    • dropping "--dir", into;
    • passing --dir the project root;
    • using a flag name the command doesn't know;
    • running the child with cwd at into instead of the project.

Nit

  • useCli sets module state (cutouts.ts:41) that this test never resets. Vitest gives each file its own module graph, so nothing leaks today. If another test is ever added to this file, a reset in afterEach would keep it from inheriting the stub child.

CI: the required checks pass at this head. Skills: manifest in sync and Studio: edit accuracy gate are skipped. The PR isn't queued, and there are no other reviews.

Verdict: APPROVE
Reasoning: The test exercises the real transcribe call and the command's own argument parser, and it fails for every wrong --dir, flag or working folder I tried.

@WaterrrForever
WaterrrForever added this pull request to the merge queue Dec 3, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants