test(runtime): tolerate node18 warning in prepare-runtime output#38
test(runtime): tolerate node18 warning in prepare-runtime output#38
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 324cdfed0e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const lines = trimmed.split(/\r?\n/).filter(Boolean); | ||
| for (let index = lines.length - 1; index >= 0; index -= 1) { | ||
| try { | ||
| return JSON.parse(lines[index]); |
There was a problem hiding this comment.
Parse trailing JSON block instead of individual lines
The fallback in parseJsonFromOutput only tries JSON.parse on each single line, which cannot parse the pretty-printed error object emitted by runPrepareRuntimeCommand (JSON.stringify(..., null, 2)), so the new logic still fails whenever a Node 18 experimental warning is prepended to stderr. In that scenario JSON.parse(trimmed) fails because of the warning prefix, each individual JSON line also fails, and the test throws Unable to parse JSON output instead of asserting on payload.code.
Useful? React with 👍 / 👎.
Summary
Validation