Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

On Windows, `report.test.ts`'s unwritable-folder case creates `\dev\null\nope` at the drive root instead of meeting an unwritable folder

オープン 初心者向け
#301 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@TheSeydiCharyyev がすでに取り組んでいます。

2026年10月29日 から。

  • #302 @TheSeydiCharyyev による — オープン

評価

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

調査の方向性

「never throws when the directory cannot be written」のケース付近にある packages/jest/src/diagnostics/__tests__/report.test.ts と、再帰的な fs.mkdir 呼び出し付近にある packages/jest/src/diagnostics/report.ts を読んでください。issue では、テストの一時フォルダー内のファイルを projectRoot として使うことが提案されています。Windows で対象を絞った Vitest のケースを実行し、ドライブのルートに何も作成せずに引き続き成功することを確認してください。

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

説明

Describe the bug

never throws when the directory cannot be written hands the diagnostics appender projectRoot: '/dev/null/nope' (report.test.ts), a folder no write reaches on Linux and macOS, where /dev/null is a device. On Windows Node resolves it against the root of the drive the run is on, and the appender's fs.mkdir(dir, { recursive: true }) (report.ts) creates it. So the case passes without meeting an unwritable folder, and leaves \dev\null\nope\.harness\diagnostics\unwritable.jsonl behind, holding the marks a and b.

While that folder exists, Windows programs that open /dev/null as a path from that drive open the folder instead: Git for Windows' git diff --no-index /dev/null <file> fails with error: Could not access '/dev/null/<file>'.

A projectRoot below a regular file fails the same way on every platform (ENOTDIR), so a file the test writes in its temporary folder would keep the case's premise on Windows too.

System Info
System:
  OS: Windows 11 10.0.26300
Binaries:
  Node: 26.12.1
  pnpm: 10.6.1
React Native Harness Version

main at 26b67ea4

Reproduction

https://github.com/callstackincubator/react-native-harness/blob/26b67ea4342d316ce105ac801a4a7f20fa711833/packages/jest/src/diagnostics/__tests__/report.test.ts#L564-L575

Steps to reproduce
  1. On Windows, in a checkout of main: pnpm install, then pnpm vitest run packages/jest/src/diagnostics/__tests__/report.test.ts -t "never throws when the directory cannot be written".
  2. The case passes: Tests 1 passed | 26 skipped (27).
  3. dir /s /b \dev on the drive the run is on lists what it made. I ran it from a drive mapped with subst, X:, so the folder landed there:
X:\dev\null
X:\dev\null\nope
X:\dev\null\nope\.harness
X:\dev\null\nope\.harness\diagnostics
X:\dev\null\nope\.harness\diagnostics\unwritable.jsonl

unwritable.jsonl:

{"label":"a","startTime":1793230779050.4949,"duration":0,"status":"ok","kind":"mark"}
{"label":"b","startTime":1793230779052.054,"duration":0,"status":"ok","kind":"mark"}

Expected: the case meets a folder it cannot write, as on Linux and macOS, and leaves nothing outside its temporary folder.

Actual: the case passes after creating the folders above at the root of the drive the run is on, with the two marks in unwritable.jsonl.

主要言語
TypeScript
スター
335
フォーク
23
平均マージ
1日 8時間
マージ済み PR(30日)
54

環境構築

はじめの一歩

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

callstackincubator/react-native-harness のほかの issue

callstackincubator/react-native-harness の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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