Address ao update test review comments#2068
Conversation
Greptile SummaryThis PR tidies up the
Confidence Score: 5/5Safe to merge — changes are confined to a single test file, replacing inline platform checks with the shared helper and adding a finally-guarded cleanup. All five guard replacements correctly use isWindows() as required by the cross-platform guide. The try/finally in the root-detect test properly guarantees temp-dir cleanup on both assertion success and failure. No production code is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/cli/tests/scripts/update-script.test.ts | Replaces five inline process.platform === "win32" guards with isWindows() per CROSS_PLATFORM.md, and wraps the root-detect test in try/finally so temp-dir cleanup is guaranteed even when the status assertion fails. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["it.skipIf(isWindows())"] --> B{Windows?}
B -- Yes --> C[Test Skipped]
B -- No --> D[spawnSync bash script]
D --> E[try block]
E --> F["expect(result.status).toBe(0)\n(fails fast with stderr/stdout msg)"]
F -- fails --> G[throw assertion error]
F -- passes --> H[readFileSync commandLog]
H --> I["expect(commands).toContain(...)"]
G --> J
I --> J["finally: rmSync(tempRoot)"]
J --> K[Temp dir cleaned up]
Reviews (2): Last reviewed commit: "Ensure update script test cleans temp di..." | Re-trigger Greptile
|
Closing this accidental follow-up. The relevant review fixes were applied directly to #2058 instead. |
Summary
Tests