Automattic / Automattic/wp-codebox
editor action unit suite crashes when RuntimeCreateSpec lacks environment
- Lingua principale
- TypeScript
- Stelle
- 17
- Fork
- 4
- Merge medio
- 59m
- PR unite (30g)
- 131
Descrizione
## Problem
`npm run test:editor-actions` currently crashes before completing because a test fixture passes a `RuntimeCreateSpec` without `environment`, while `secretEnvPhp()` dereferences `spec.environment.databaseSetup` unconditionally.
## Failure
```text
TypeError: Cannot read properties of undefined (reading 'databaseSetup')
at secretEnvPhp (.../packages/runtime-playground/src/php-bootstrap.ts:280:24)
at bootstrapPhpCode (.../packages/runtime-playground/src/php-bootstrap.ts:41:3)
at resolveEditorOpenTarget (.../packages/runtime-playground/src/editor-actions.ts:140:11)
at .../tests/editor-actions.test.ts:288:24
```
## Expected
The test fixture should supply a valid runtime environment, or the bootstrap contract should reject/normalize the incomplete spec before dereferencing it. The editor action suite should run to completion on current `main`.
Discovered while validating the post-merge security hardening for #2094; the affected bootstrap and test fixture are outside that PR's changes.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia da tests/editor-actions.test.ts intorno alla riga 288, quindi esamina resolveEditorOpenTarget in packages/runtime-playground/src/editor-actions.ts e secretEnvPhp in packages/runtime-playground/src/php-bootstrap.ts. Esegui npm run test:editor-actions per riprodurre il crash. Il lavoro è completato quando la suite termina correttamente con un percorso di gestione valido per un RuntimeCreateSpec senza ambiente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- testing
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 72/100