Skip to content

test: run unit tests on Vitest - #80

Merged
aresnik11 merged 11 commits into
mainfrom
ajr-vitest-migrate
Nov 18, 2026
Merged

aresnik11 merged 11 commits into
mainfrom
ajr-vitest-migrate

Conversation

@aresnik11

@aresnik11 aresnik11 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Part 3 of 4 in the Jest → Vitest migration, stacked on #79. This PR moves every non-story test from Jest to Vitest. It's step 4 of the testing revamp plan ("migrate node tests Jest → Vitest"). One Vitest workspace in the root vitest.config.ts now holds every test project: the existing Storybook browser project plus the unit tests, which used to run as one Jest project per package. Each package keeps its own Nx test target, which now runs Vitest on that package's files.

Each package's Jest setup is replaced in this PR, because it would break once the tests are Vitest code: its jest.config.ts, its Nx test target, and jest in its spec tsconfig types. The shared Jest infrastructure stays for now: the root Jest configs and preset, script/jest/, the @nx/jest target default and the Jest dependencies. #81 removes those, which keeps this PR focused on the switch and easy to revert.

Results: 1,277 tests in 77 files pass. That's the same count as Jest plus node --test on #79.

One Vitest workspace, three projects

  • storybook: the existing browser project, unchanged apart from now sitting in test.projects.
  • jsdom: gamut, gamut-styles, gamut-icons, gamut-illustrations, gamut-patterns, variance. Component, hook and style tests that need a DOM. Going to look into moving/removing some of these in the future
  • node: eslint-plugin-gamut, gamut-codemods, gamut-agent-tools. Node tooling tests that ran in Jest's node environment and shouldn't get jsdom's browser globals.

I chose a separate node project over adding // @vitest-environment node to the top of 11 files, so each group's environment is set in one place. environmentMatchGlobs would also work, but Vitest has deprecated it.

Coverage (v8) and reporters are set for the whole workspace, because Vitest doesn't allow them per project. Each package's run writes coverage, lcov and junit to coverage/vitest/<package>/, the same one-directory-per-package layout Jest used under coverage/packages/. As with Jest, coverage only reports files the tests load (all: false).

Setup files (script/vitest/)

  • jsdom-setup.ts:
    • Registers the jest-dom matchers and @emotion/jest's toHaveStyleRule. @emotion/jest types its matchers for Jest's expect, hence the cast. Its runtime has no Jest dependency, and there's no @emotion/vitest.
    • Registers RTL cleanup. RTL only registers it automatically when afterEach is a global, and we're keeping Vitest's default of globals: false, so tests import describe/it/expect/vi from vitest.
    • Deletes the undefined window.matchMedia that Vitest's jsdom environment defines. jsdom doesn't implement matchMedia, but Vitest copies a fixed list of window keys onto the global, so the key exists with no value. That made 'matchMedia' in window true in usePrefersDarkMode, and every test that rendered through a provider threw.
    • Doesn't port Jest's Date.now pin or window.scrollTo stub. Nothing calls either, and the suite passes without them.
  • node-setup.ts: points ESLint's RuleTester at Vitest's describe/it. Without globals, RuleTester would run its cases outside any test.

Converting the tests

  • jest.* became vi.*, with explicit imports from vitest.
  • jest.mock + requireActual became an async factory using importOriginal.
  • Mock factories that require()d a sibling mock module now use vi.hoisted, so gamut-styles' fontUtilsMock.ts is deleted.
  • fontUtils.test.ts: jest.doMock + resetModules + require became vi.doMock + vi.resetModules + await import().
  • codemods cli.test.ts: cli.ts loads jscodeshift's Runner with require(), which vi.mock can't intercept. The test spies on the shared CommonJS module object instead, and cli.ts is unchanged.
  • gamut-agent-tools: node:test became Vitest (before/after became beforeAll/afterAll). node:assert is kept. The test:bin script is removed, and the package's Nx test target now runs Vitest like the others.
  • Five snapshot files were rewritten. Only the header and the test-name keys changed: Vitest joins describe/it names with >, and the variance it.each titles format their %o args differently. I diffed the stored values against Jest's with the keys excluded, and they're identical.

Running tests

  • yarn test is unchanged: nx run-many --target=test --all. Each package's test target goes from @nx/jest:jest to nx:run-commands, running vitest run --project=jsdom --project=node packages/<package>/. The trailing path limits the run to that package's test files. Listing both projects is harmless, because the one a package doesn't use matches none of its files. The flags are there to leave out the storybook project, which would otherwise run that package's stories in Chromium.
  • The targets follow the old Jest ones. Each project.json declares its own executor, outputs and command. nx.json's targetDefaults.test holds what they share: cache, dependsOn: ["^build"], and inputs, which add vitest.config.ts, the setup files and the CI env var.
  • The build is still needed, and ^build handles it per package: gamut, gamut-styles and codemods import sibling packages through their dist, and codemods' manifest.test.ts type-checks the built .d.ts files. gamut-icons and gamut-patterns also depend on their own build, because it generates the src/icons and src/patterns their tests import (same as their Jest targets).
  • codemods' manifest.test.ts gets a 15s timeout on its describe block. Two of its tests build a TypeScript program over the built packages. Locally they take under a second, but on CI with Nx building other packages in parallel, one took 7.7s and failed at Vitest's 5s default.
  • gamut-tests has no tests, so its test target (Jest with passWithNoTests) is removed rather than ported.
  • Per-package coverage directories come from NX_TASK_TARGET_PROJECT, which Nx sets for each task. Nx runs up to three packages in parallel, and with one shared directory they raced on Vitest's coverage/.tmp and failed with ENOENT. Passing --coverage.reportsDirectory per target doesn't work: CI's trailing --coverage replaces the whole coverage option.
  • CI runs yarn test --coverage. --ci and --runInBand were Jest-only flags, and Vitest rejects unknown flags. Stories still run in their own test-storybook job.
  • New yarn test:watch script, which watches the jsdom and node projects across all packages. Adds @vitest/coverage-v8.

Known limitations

  • Codecov numbers may shift: coverage now comes from v8, not Babel/istanbul.
  • Story coverage still isn't uploaded. test-storybook runs without --coverage, as on main.
  • Pre-existing issues this PR doesn't touch: a no-console lint error in codemods' cli.test.ts, and type errors in some gamut, gamut-styles and variance test files. CI doesn't typecheck those tests.

Notes for reviewers

  • cli.test.ts covers how the codemod handles jest.config.js in consumer repos. That's codemod behavior, not leftover Jest setup.
  • I also tried folding the stories into each package's test target and merging test-storybook into the test job (828d9e494, 29fc8697d), then reverted it (e19ce89ec). That's for a follow-up ticket. On one 4-core runner, the test step took 3m 31s, against 47s of unit tests and 1m 44s of stories when they ran on separate machines. The codemods manifest tests also slowed from about 7s to 19.5s next to Chromium.

PR Checklist

  • Related to designs: N/A
  • Related to JIRA ticket: [ABC-123]
  • Changeset added (or empty changeset if no release)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • Package previews from this PR are passing end-to-end tests in all relevant consuming repositories

Testing Instructions

  1. Run yarn test. Nx should build the packages the tests need, then run a test task for each of the 9 packages with tests, passing 1,277 tests in 77 files. Run it again and every task should come from the Nx cache.
  2. Run CI=true yarn test --coverage --skip-nx-cache. Check that each package has its own coverage/vitest/<package>/ directory with lcov.info and junit.xml.
  3. Run yarn nx run gamut-icons:test. It should build gamut-icons first, then pass 2 test files.
  4. Run yarn test:stories. All 686 story tests in 87 files should pass.
  5. Run yarn verify. It should pass.
  6. Run yarn test:watch, edit a test file, and check that it re-runs.

PR Links and Envs

Repository PR Link
N/A Test tooling only.

🤖 Generated with Claude Code

aresnik11 and others added 3 commits November 13, 2026 09:55
title.macro hasn't been imported since the Storybook 8 move, which
relies on auto-titles. Also drop babel-plugin-macros and the unused
@testing-library/react-hooks and react-test-renderer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Story tests pass unpinned and pinned to month-, year-, and leap-day
edges. Unpinned, a11y checks also cover the "today" cell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move every test out of __tests__/tests folders and split codemods'
lib.test.ts per module. Still runs on Jest; keep tests out of builds,
coverage, and npm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aresnik11 aresnik11 mentioned this pull request Nov 13, 2026
2 of 7 tasks
Add jsdom and node Vitest projects alongside storybook, port every
non-story test from Jest (and agent-tools from node:test), and run them
all from one vitest:test Nx target. Jest stays installed until the next PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aresnik11
aresnik11 marked this pull request as ready for review November 16, 2026 19:22
@aresnik11
aresnik11 requested a review from a team as a code owner November 16, 2026 19:22
Base automatically changed from ajr-vitest-colocate to main November 16, 2026 20:23
# Conflicts:
#	packages/gamut-agent-tools/cli/lib/design.test.mjs
#	packages/gamut-agent-tools/package.json
#	packages/gamut-agent-tools/project.json
#	packages/gamut-codemods/src/lib/eslint.test.ts
#	packages/gamut-codemods/src/lib/git.test.ts
#	packages/gamut-codemods/src/lib/leftovers.test.ts
#	packages/gamut-codemods/src/lib/manifest.test.ts
#	packages/gamut-codemods/src/migrations/eslint-comments/index.test.ts
#	packages/gamut-codemods/src/migrations/markdown-video-overrides/index.test.ts
#	packages/gamut-codemods/src/presets/index.test.ts
#	packages/gamut-icons/jest.config.ts
#	packages/gamut-icons/tsconfig.json
#	packages/gamut-illustrations/tsconfig.json
#	packages/gamut-patterns/jest.config.ts
#	packages/gamut-patterns/tsconfig.json
#	packages/gamut-styles/src/AssetProvider.fontLoading.test.tsx
#	packages/gamut-styles/src/AssetProvider.test.tsx
#	packages/gamut-styles/src/Background.test.tsx
#	packages/gamut-styles/src/GamutProvider.test.tsx
#	packages/gamut-styles/src/cache/createEmotionCache.test.ts
#	packages/gamut-styles/src/fontUtilsMock.ts
#	packages/gamut-styles/src/themes/theme.test.ts
#	packages/gamut-styles/src/utilities/elementDir.test.ts
#	packages/gamut-styles/src/utilities/fontUtils.test.ts
#	packages/gamut-styles/src/utilities/themed.test.ts
#	packages/gamut-styles/tsconfig.lib.json
#	packages/gamut/src/index.test.ts
#	packages/gamut/src/utils/generateResponsiveClassnames.test.ts
#	packages/gamut/src/utils/nullish.test.ts
#	packages/variance/integration/__snapshots__/variance.test.ts.snap
#	packages/variance/integration/component.test.tsx
#	packages/variance/integration/queries.test.ts
#	packages/variance/src/transforms/transformSize.test.ts
#	packages/variance/src/utils/propNames.test.ts
#	vitest.config.ts
@pkg-pr-new

pkg-pr-new Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@skillsoft/eslint-plugin-gamut

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/eslint-plugin-gamut@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/eslint-plugin-gamut@80.tgz

@skillsoft/gamut

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut@80.tgz

@skillsoft/gamut-agent-tools

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-agent-tools@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-agent-tools@80.tgz

@skillsoft/gamut-codemods

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-codemods@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-codemods@80.tgz

@skillsoft/gamut-icons

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-icons@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-icons@80.tgz

@skillsoft/gamut-illustrations

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-illustrations@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-illustrations@80.tgz

@skillsoft/gamut-patterns

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-patterns@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-patterns@80.tgz

@skillsoft/gamut-styles

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-styles@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-styles@80.tgz

@skillsoft/gamut-tests

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-tests@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/gamut-tests@80.tgz

@skillsoft/variance

npm i https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/variance@80
yarn add https://pkg.pr.new/Codecademy/skillsoft-gamut/@skillsoft/variance@80.tgz

commit: 6faba7c

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@590716a). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #80   +/-   ##
=======================================
  Coverage        ?   77.20%           
=======================================
  Files           ?      464           
  Lines           ?    32091           
  Branches        ?     1536           
=======================================
  Hits            ?    24776           
  Misses          ?     7307           
  Partials        ?        8           
Flag Coverage Δ
pull-request 77.20% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The watch command bypasses Nx build prerequisites, causing test collection to fail on a clean checkout when required package artifacts are missing.

1 open issue
What changed in this PR

Moves Gamut’s non-story tests to Vitest, completing the runner migration after #79’s test relocation. Shared Jest infrastructure remains for removal in #81.

Changes:

  • Consolidates testing into Storybook, jsdom, and Node projects with shared coverage reporting.
  • Converts test imports, mocks, hooks, and snapshots to Vitest.
  • Replaces package-level test targets with one build-aware Nx target and updates scripts, CI, and documentation.
File Description
yarn.lock Locks coverage dependencies and related updates.
vitest.config.ts Defines three test projects and shared reporting.
script/​vitest/​project.json Adds the build-aware unit-test target.
script/​vitest/​node-setup.ts Connects ESLint RuleTester to Vitest.
script/​vitest/​jsdom-setup.ts Registers matchers, cleanup, and jsdom adjustments.
packages/​variance/​tsconfig.spec.json Removes Jest test types and config inclusion.
packages/​variance/​tsconfig.lib.json Removes the obsolete Jest config exclusion.
packages/​variance/​src/​utils/​propNames.test.ts Imports Vitest test APIs.
packages/​variance/​src/​transforms/​transformSize.test.ts Imports Vitest test APIs.
packages/​variance/​src/​getPropertyMode/​getPropertyMode.test.ts Imports Vitest test APIs.
packages/​variance/​src/​createTheme/​createTheme.test.ts Imports Vitest test APIs.
packages/​variance/​project.json Removes the package-level Jest target.
packages/​variance/​jest.config.ts Deletes the package’s Jest configuration.
packages/​variance/​integration/​variance.test.ts Converts test APIs and mocks.
packages/​variance/​integration/​queries.test.ts Imports Vitest test APIs.
packages/​variance/​integration/​component.test.tsx Uses Vitest and shared Emotion matchers.
packages/​variance/​integration/​__snapshots__/​variance.test.ts.snap Updates snapshot headers and keys.
packages/​gamut/​tsconfig.spec.json Switches to Vitest-compatible matcher types.
packages/​gamut/​tsconfig.lib.json Removes the obsolete Jest config exclusion.
packages/​gamut/​src/​utils/​omitProps.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​utils/​nullish.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​utils/​generateResponsiveClassnames.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​Tips/​shared/​utils.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Tips/​shared/​popoverAlignmentUtils.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​ProgressBar/​ProgressBar.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​PopoverContainer/​testUtils.ts Converts the DOM rectangle mock to Vitest.
packages/​gamut/​src/​PopoverContainer/​PopoverContainer.test.tsx Converts mocks, spies, and test APIs.
packages/​gamut/​src/​PopoverContainer/​hooks.test.tsx Imports Vitest hooks and test APIs.
packages/​gamut/​src/​Popover/​utils.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​Popover/​styles/​beak.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​PatternBackdrop/​PatternBackdrop.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Modals/​Modal.test.tsx Converts test APIs and callback mocks.
packages/​gamut/​src/​Modals/​Dialog.test.tsx Converts test APIs and callback mocks.
packages/​gamut/​src/​Menu/​Menu.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Markdown/​libs/​overrides/​Video/​MarkdownVideo.test.tsx Converts media module mocks to Vitest.
packages/​gamut/​src/​index.test.ts Uses Vitest for export snapshots.
packages/​gamut/​src/​Form/​utils.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Form/​inputs/​SelectDropdown/​hooks/​useNoOptionsAnnouncement.test.tsx Converts fake timers and test APIs.
packages/​gamut/​src/​Form/​inputs/​SelectDropdown/​core/​utils.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Form/​__snapshots__/​utils.test.tsx.snap Updates snapshot headers and keys.
packages/​gamut/​src/​FeatureShimmer/​FeatureShimmer.test.tsx Converts mocks and partial module loading.
packages/​gamut/​src/​DatePicker/​utils/​locale.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​DatePicker/​DatePickerInput/​utils/​validation.test.ts Converts test APIs and validation mocks.
packages/​gamut/​src/​DatePicker/​DatePickerInput/​Segment/​utils.test.ts Converts date spies and lifecycle hooks.
packages/​gamut/​src/​DatePicker/​DatePickerContext/​DatePickerContext.test.tsx Converts context callback mocks.
packages/​gamut/​src/​DatePicker/​DatePickerCalendar/​utils/​quickActions.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​DatePicker/​DatePickerCalendar/​utils/​dateSelect.test.ts Converts selection callback mocks.
packages/​gamut/​src/​DatePicker/​DatePickerCalendar/​Calendar/​utils/​keyHandler.test.tsx Converts keyboard-event and callback mocks.
packages/​gamut/​src/​DatePicker/​DatePickerCalendar/​Calendar/​utils/​format.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​DatePicker/​DatePickerCalendar/​Calendar/​utils/​dateGrid.test.ts Imports Vitest test APIs.
packages/​gamut/​src/​DatePicker/​DatePickerCalendar/​Calendar/​CalendarBody.test.tsx Converts calendar callback mocks.
packages/​gamut/​src/​ConnectedForm/​ConnectedInputs/​ConnectedNestedCheckboxes/​utils.test.tsx Converts checkbox callback mocks.
packages/​gamut/​src/​Card/​Card.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​ButtonBase/​ButtonBase.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​BarChart/​utils/​index.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Anchor/​Anchor.test.tsx Imports Vitest test APIs.
packages/​gamut/​src/​Alert/​Alert.test.tsx Converts test APIs and close-handler mocks.
packages/​gamut/​src/​__snapshots__/​index.test.ts.snap Updates the snapshot header.
packages/​gamut/​project.json Removes the package-level Jest target.
packages/​gamut/​jest.config.ts Deletes the package’s Jest configuration.
packages/​gamut-tests/​project.json Removes the package-level Jest target.
packages/​gamut-styles/​tsconfig.spec.json Adds Vitest-compatible matcher types.
packages/​gamut-styles/​tsconfig.lib.json Removes exclusions for deleted files.
packages/​gamut-styles/​src/​utilities/​useLogicalProperties.test.tsx Imports Vitest test APIs.
packages/​gamut-styles/​src/​utilities/​useElementDir.test.tsx Imports Vitest hooks and test APIs.
packages/​gamut-styles/​src/​utilities/​themed.test.ts Imports Vitest test APIs.
packages/​gamut-styles/​src/​utilities/​fontUtils.test.ts Converts module mocks and dynamic reimports.
packages/​gamut-styles/​src/​utilities/​elementDir.test.ts Imports Vitest hooks and test APIs.
packages/​gamut-styles/​src/​themes/​theme.test.ts Imports Vitest test APIs.
packages/​gamut-styles/​src/​themes/​__snapshots__/​theme.test.ts.snap Updates snapshot headers and keys.
packages/​gamut-styles/​src/​GamutProvider.test.tsx Converts provider mocks and reset hooks.
packages/​gamut-styles/​src/​GamutProvider.csp.test.tsx Imports Vitest hooks and test APIs.
packages/​gamut-styles/​src/​fontUtilsMock.ts Deletes the superseded shared mock.
packages/​gamut-styles/​src/​cache/​createEmotionCache.test.ts Imports Vitest hooks and test APIs.
packages/​gamut-styles/​src/​Background.test.tsx Uses Vitest and shared Emotion matchers.
packages/​gamut-styles/​src/​AssetProvider.test.tsx Introduces hoisted Vitest font mocks.
packages/​gamut-styles/​src/​AssetProvider.fontLoading.test.tsx Converts font-loading and fetch mocks.
packages/​gamut-styles/​project.json Removes the package-level Jest target.
packages/​gamut-styles/​jest.config.ts Deletes the package’s Jest configuration.
packages/​gamut-patterns/​tsconfig.json Removes the obsolete Jest config exclusion.
packages/​gamut-patterns/​src/​patterns.test.tsx Imports Vitest test APIs.
packages/​gamut-patterns/​project.json Removes the package-level Jest target.
packages/​gamut-patterns/​jest.config.ts Deletes the package’s Jest configuration.
packages/​gamut-illustrations/​tsconfig.json Removes Jest types and config exclusion.
packages/​gamut-illustrations/​src/​index.test.tsx Imports Vitest test APIs.
packages/​gamut-illustrations/​project.json Removes the package-level Jest target.
packages/​gamut-illustrations/​jest.config.ts Deletes the package’s Jest configuration.
packages/​gamut-icons/​tsconfig.json Removes the obsolete Jest config exclusion.
packages/​gamut-icons/​src/​index.test.tsx Imports Vitest test APIs.
packages/​gamut-icons/​project.json Removes the package-level Jest target.
packages/​gamut-icons/​mask-plugin.test.tsx Imports Vitest test APIs.
packages/​gamut-icons/​jest.config.ts Deletes the package’s Jest configuration.
packages/​gamut-codemods/​tsconfig.spec.json Removes Jest types and config inclusion.
packages/​gamut-codemods/​tsconfig.lib.json Removes the obsolete Jest config exclusion.
packages/​gamut-codemods/​src/​transform.test.ts Imports Vitest for fixture tests.
packages/​gamut-codemods/​src/​presets/​manifest.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​presets/​index.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​migrations/​markdown-video-overrides/​index.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​migrations/​eslint-comments/​index.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​lib/​module-strings.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​lib/​manifest.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​lib/​leftovers.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​lib/​git.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​lib/​eslint.test.ts Imports Vitest test APIs.
packages/​gamut-codemods/​src/​cli.test.ts Replaces Runner module mocking with a CommonJS spy.
packages/​gamut-codemods/​README.md Documents the new test commands.
packages/​gamut-codemods/​project.json Removes the package-level Jest target.
packages/​gamut-codemods/​jest.config.ts Deletes the package’s Jest configuration.
packages/​gamut-agent-tools/​project.json Removes the standalone Node test target.
packages/​gamut-agent-tools/​package.json Removes the standalone test script.
packages/​gamut-agent-tools/​cli/​lib/​design.test.mjs Replaces Node test APIs with Vitest.
packages/​eslint-plugin-gamut/​tsconfig.spec.json Removes Jest types and config inclusion.
packages/​eslint-plugin-gamut/​tsconfig.lib.json Removes the obsolete Jest config exclusion.
packages/​eslint-plugin-gamut/​project.json Removes the package-level Jest target.
packages/​eslint-plugin-gamut/​jest.config.ts Deletes the package’s Jest configuration.
package.json Adds coverage support and updates test scripts.
CONTRIBUTING.md Clarifies that unit testing builds packages first.
.github/​workflows/​quality.yml Removes Jest-only command-line flags.
.changeset/​brave-tests-run.md Records the test-tooling migration.

Review effort: Balanced

Comment thread package.json Outdated
"test": "nx run vitest:test",
"test:stories": "vitest run --project=storybook",
"test:stories:watch": "vitest --project=storybook",
"test:watch": "vitest --project=jsdom --project=node",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could be nx watch --all -- nx run \$NX_PROJECT_NAME:test

aresnik11 and others added 4 commits November 18, 2026 11:45
Each package's test target runs its own Vitest files, stories included.
Folds the test-storybook job into test to compare CI time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They type-check built packages and time out when sharing CPU with Chromium.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Undo folding stories into the test job; that moves to a future ticket.
Unit tests stay on per-package Vitest targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They still time out on CI while Nx builds other packages in parallel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jakemhiller jakemhiller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm! added a comment about the yarn test:watch command, but it isn't blocking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aresnik11
aresnik11 merged commit e3afd9c into main Nov 18, 2026
1 check passed
@aresnik11
aresnik11 deleted the ajr-vitest-migrate branch November 18, 2026 19:50
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.

3 participants