Skip to content

editor action unit suite crashes when RuntimeCreateSpec lacks environment #2105

Description

@chubes4

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions