chore: use `ps-list` instead of `pidtree` to remove wmic by mark-wiemer · Pull Request #5479 · mochajs/mocha
PR Checklist
- Addresses an existing open issue: fixes 🛠 Repo:
test-node:integrationon windows-latest for--paralleltests #5467 - That issue was marked as
status: accepting prs - Steps in CONTRIBUTING.md were taken
Overview
pidtree relies on wmic, an outdated Windows utility which is no longer included in the latest versions of Windows Server. GitHub Actions uses Windows Server, so any test using wmic fails, including our 2 tests that use pidtree. We are able to switch to a more modern ps-list (no new deps in package-lock) to fix this.
Took this opportunity to simplify the tests as well: They now expect a list of falses indicating the processes don't exist. Although this may harm debuggability, these tests haven't failed in years and readability feels more important for future maintenance work.
ps-list requires Node 20+, so this is blocked on #5477