Skip to content

loopguard: count npm, pnpm and yarn test runs past their options and aliases - #336

Open
Rithindatta Gundu (rithindattag) wants to merge 1 commit into
microsoft:mainfrom
rithindattag:loopguard-js-package-managers
Open

Rithindatta Gundu (rithindattag) wants to merge 1 commit into
microsoft:mainfrom
rithindattag:loopguard-js-package-managers

Conversation

@rithindattag

Copy link
Copy Markdown
Contributor

Fixes #335

The loop guard read npm test, pnpm test and yarn test only right after the package manager, so a monorepo's pnpm --filter web test, pnpm -r test, npm -w web test or yarn workspace web test, the npm t / pnpm tst aliases, and pnpm vitest run / yarn jest weren't verifications. A failing one after the last edit left the turn green.

Each manager now has its own options before the command (npm's -w names a workspace; pnpm's is --workspace-root, a flag), with the value of those that take one, including a $(...). As in #279, an option is read only one way, so a long line of options that runs no tests doesn't backtrack exponentially; a test pins that. npm -w test run build, npm token list and yarn workspace web add jest still don't count. Not covered here: Yarn Berry's yarn workspaces foreach and bun --cwd.

Tested: new tests/test_loopguard_js_package_managers.py (39 of its 61 cases fail without the change); full python -m pytest tests -n 4 passes (1629 passed, 40 skipped) on MacOS, Python 3.13.5.

…aliases

pnpm --filter web test, npm -w web test, yarn workspace web test, npm t and pnpm vitest run were not counted as test runs, so a failing one after the last edit left the turn green and fed the envelope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loopguard: pnpm --filter web test, npm -w web test, npm t and pnpm vitest run are not counted as test runs

1 participant