Skip to content

chore: migrate from yarn/mocha to npm/vitest#101

Merged
eablack merged 1 commit into
mainfrom
eb/migrate-to-vitest-and-npm
Jun 9, 2026
Merged

chore: migrate from yarn/mocha to npm/vitest#101
eablack merged 1 commit into
mainfrom
eb/migrate-to-vitest-and-npm

Conversation

@eablack

@eablack eablack commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves all 22 yarn audit vulnerabilities by replacing the mocha + nyc + chai + ts-node test toolchain with vitest, and switches the package manager from yarn to npm. 21 of the 22 advisories were transitive deps of the old test toolchain (brace-expansion, serialize-javascript, diff); the last one (node-notifier > uuid@8.3.2) is cleared with a single uuid: ^11.1.1 override.

Test framework migration

  • Replace mocha, nyc, chai, ts-node, @types/mocha, @types/chai, eslint-plugin-mocha with vitest + @vitest/coverage-v8
  • Update lone test file to import describe/it from vitest
  • Delete test/helpers/init.js and test/tsconfig.json (mocha-specific)
  • Drop the mocha config block from package.json and the mocha/no-mocha-arrows rule from eslint config

Package manager migration

  • Replace yarn.lock with package-lock.json and un-ignore it in .gitignore
  • Convert resolutionsoverrides in package.json
  • Switch CI workflow to cache: npm / npm ci / npm test / npm run lint
  • Switch reusable release workflows to package-manager: npm

Also includes in-flight changes from the update-release-configs.yml workflow that were already present in the working tree (formatting in dependabot.yml, expanded changelog-sections in release-please configs).

Type of Change

  • chore: Change that does not affect production code

Testing

Steps:

  1. Passing CI suffices.
  2. Locally: npm ci && npm test && npm audit — all green, 0 vulnerabilities.

Related Issues

GitHub issue: N/A
GUS work item: N/A

Resolves all 22 yarn audit vulnerabilities by replacing the mocha + nyc +
chai + ts-node toolchain with vitest, and switches the package manager
from yarn to npm.

- Replace mocha/nyc/chai/ts-node with vitest + @vitest/coverage-v8
- Drop test/helpers/init.js and test/tsconfig.json (mocha-only)
- Replace yarn.lock with package-lock.json; convert resolutions to overrides
- Update CI and release workflows to use npm
- Override uuid to ^11.1.1 to clear remaining node-notifier advisory
@eablack eablack requested a review from a team as a code owner June 9, 2026 21:23

@michaelmalave michaelmalave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eablack eablack merged commit c966d0d into main Jun 9, 2026
7 checks passed
@eablack eablack deleted the eb/migrate-to-vitest-and-npm branch June 9, 2026 21:59
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.

2 participants