Handler tests for stop/pause/resume branches that only a live capture reaches

オープン
#348 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
desktop, testing

調査の方向性

Read src/tools/stopRecording.ts, src/tools/pauseRecording.ts, and src/tools/resumeRecording.ts, then follow the fake-spawn harness in src/__tests__/startRecording.test.ts. Add handler-level tests for the listed arm, ended-session, ownership, webcam, pause, and resume cases; run npm test and confirm the tests cover those branches and the src/tools/** coverage floor passes.

索引モデルが issue の本文から書いたものです。

説明

effort: medium help wanted priority: medium testing

Summary

stop_recording, pause_recording and resume_recording contain branches of their own beyond utils/lifecycle.ts: arm-id routing, the already-ended path that finishes a leftover replay buffer and picks a note by endReason, the foreign-owner refusal, webcamReport, and the "Already paused" / "Already recording" short-circuits. Only the Windows capture smoke and opt-in local tests call these tools, and the smoke is the flaky one (#331). Local coverage without the smoke: stopRecording.ts 30.6% lines / 19.2% branches, pauseRecording.ts 16.7% / 0%, resumeRecording.ts 15.4% / 0%. The src/tools/** 77% floor fails locally (76.3%).

Where

  • src/tools/stopRecording.ts:25-54, 86-128
  • src/tools/pauseRecording.ts:27-35, src/tools/resumeRecording.ts:27-35
  • src/__tests__/captureSmoke.test.ts:19 (gated by RUN_CAPTURE_SMOKE)

Suggested fix

Add a handler-level test file that reuses the fake-spawn harness in src/__tests__/startRecording.test.ts:23-58 (seeded SessionStore, InMemoryTransport client). Cases:

  • stop_recording with a waiting arm- id: status "cancelled", note "Disarmed", and the arm is gone.
  • stop_recording with an unknown arm- id: isError "No armed recording".
  • stop_recording with an arm whose start failed: status "failed" plus error.
  • stop_recording with an arm that started: stops the arm's sessionId.
  • stop_recording on a stopped session with endReason max_duration / window_closed / undefined: the three notes, and no kill.
  • stop_recording on an ended session with a replay dir: save:false gives replay.discarded; save:true with a failing save gives replay.error.
  • stop_recording on a live record owned by another live pid: the foreignStopRefusal error, and the process is not killed.
  • webcam report: missing file gives webcam.error; probe-able files give overlay.
  • pause_recording on an already paused session: "Already paused."; unknown id gives isError.
  • resume_recording on a recording session: "Already recording."; the result carries remainingSec only when capSec > 0.

Getting started

  • Relevant files: src/tools/stopRecording.ts, src/__tests__/startRecording.test.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at b9b94fa. Severity: medium. Effort: M. audit-key: testing|src/tools/stopRecording.ts|register

主要言語
TypeScript
スター
1
フォーク
4
平均マージ
14時間 8分
マージ済み PR(30日)
48

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/screencast-mcp のほかの issue

TMHSDigital/screencast-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。