Repository navigation
Tests on vitest instead of jest: pnpm audit is clean - #22
Merged
Merged
Conversation
CI's pnpm audit --audit-level high failed on advisories that all came in through jest and ts-jest, none in patchflow's own dependencies: - braces 3.0.3 (high, GHSA-vfj7-8cjw-p6xm), through jest's micromatch; npm has no fixed release - handlebars 4.7.9 (critical, moderate), through ts-jest - sprintf-js 1.0.3 (moderate), through jest's istanbul The tests now run on vitest 5 (jest's API: describe/it/expect as globals, one file at a time as --runInBand did), which brings none of them: pnpm audit finds no known vulnerabilities at any level, without overrides, patches or ignored advisories. - vitest.config.ts replaces jest.config.cjs; jest.spyOn becomes vi.spyOn (the one jest-specific call); tsconfig and oxlint use vitest's globals. - snapshot-join's synchronous fuzz takes about 16 s: it gets an explicit 120 s timeout (jest never timed synchronous tests; vitest does), as mixed-version's fuzz has one. pnpm check: 157 tests pass (the MIXED_FUZZ suite skipped, as before), oxlint and tsc clean, the build works.
williamstein
commented
Oct 9, 2026
williamstein
left a comment
Contributor
Author
There was a problem hiding this comment.
Automated technical review of exact head d5be4619fed81a7b84a28bf25c09045cf073512c: no findings.
I checked the Jest/Vitest configuration and test-call changes, the dependency/lockfile delta, and CI's Node 24 environment. fileParallelism: false preserves the important one-test-file-at-a-time property; the one API-specific change (jest.spyOn to vi.spyOn) and the explicit synchronous-fuzz timeout are appropriate.
Independent validation:
pnpm install --frozen-lockfilepnpm audit— no known vulnerabilities at any severitypnpm check— 157 passed, 1 skipped; oxlint clean; types/ESM/CJS builds clean
This is ready to merge before rebasing #21.
This was referenced Oct 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI runs
pnpm audit --audit-level high, and it fails onmain, so every PR fails, including #21. All five advisories come in through jest and ts-jest; none is in patchflow's own dependencies.braces3.0.3 (GHSA-vfj7-8cjw-p6xm)handlebars4.7.9sprintf-js1.0.3There is no fixed
bracesrelease, so overrides alone can't fix it. A pnpm patch would, as in cocalc-ai #962, but version-only audits still flag patched versions, and ignoring advisories would hide them.What
The tests run on vitest 5 instead of jest. Vitest has jest's API and brings none of these packages. Afterwards
pnpm auditreports no known vulnerabilities at any level, with no overrides, patches or ignored advisories.vitest.config.tsreplacesjest.config.cjs:describe/it/expectas globals, as the tests are written;--runInBanddid.jest.spyOnbecomesvi.spyOn, the only jest-specific call.120_000timeout. Jest never timed synchronous tests; vitest does. mixed-version's fuzz already has one.Checks
pnpm audit(all levels): no known vulnerabilities.pnpm check:MIXED_FUZZsuite is skipped, as before;After this merges, #21 needs to be rebased on
mainto pick it up.