On Windows, `report.test.ts`'s unwritable-folder case creates `\dev\null\nope` at the drive root instead of meeting an unwritable folder
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #302 di @TheSeydiCharyyev — integrata
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- testing
Direzione di ricerca
Leggi packages/jest/src/diagnostics/__tests__/report.test.ts intorno al caso “never throws when the directory cannot be written” e packages/jest/src/diagnostics/report.ts intorno alla chiamata ricorsiva a fs.mkdir. L’issue suggerisce di usare un file nella cartella temporanea del test come projectRoot; esegui il caso Vitest mirato su Windows e conferma che passa ancora senza creare nulla nella radice dell’unità.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
Steps to reproduce
- On Windows, in a checkout of
main:pnpm install, thenpnpm vitest run packages/jest/src/diagnostics/__tests__/report.test.ts -t "never throws when the directory cannot be written". - The case passes:
Tests 1 passed | 26 skipped (27). dir /s /b \devon the drive the run is on lists what it made. I ran it from a drive mapped withsubst,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.
- Lingua principale
- TypeScript
- Stelle
- 340
- Fork
- 23
- Merge medio
- 1g 19h
- PR unite (30g)
- 58
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di callstackincubator/react-native-harness
-
afterEach hooks run outer suite first, unlike JestForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
callstackincubator/react-native-harness#296 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
callstackincubator/react-native-harness#128 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
callstackincubator/react-native-harness#303 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
callstackincubator/react-native-harness#300 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
callstackincubator/react-native-harness#299 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di callstackincubator/react-native-harness
Issue simili
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info onlyApertaenhancement from-x
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
nightly-labs/openbot#4867 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
egonSchiele/agency-lang#1377 ·
I maintainer di solito rispondono entro 1 giorno
-
normalizePath removes the Windows device namespace prefixForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
caprover/caprover-frontend#273 ·
I maintainer di solito rispondono entro 1 giorno