Skip to content

Comments

Migrate to vitest#5740

Open
Juveniel wants to merge 8 commits intodevelopfrom
migrate-to-vitest
Open

Migrate to vitest#5740
Juveniel wants to merge 8 commits intodevelopfrom
migrate-to-vitest

Conversation

@Juveniel
Copy link
Contributor

No description provided.

@Juveniel Juveniel self-assigned this Jan 27, 2026
@Juveniel Juveniel requested a review from a team as a code owner January 27, 2026 08:26
@Juveniel Juveniel added Enhancement New feature of an existing functionality or an improvement of an existing functionality. Infrastructure Issues related overall infrastructure for build, test and deployment labels Jan 27, 2026
@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Packages Report

core default classic bootstrap material fluent utils html
Size 32.97 KB (0.0%) 849.69 KB (0.0%) 848.37 KB (0.0%) 863.50 KB (0.0%) 1047.35 KB (0.0%) 1290.83 KB (0.0%) 625.13 KB (0.0%) 48.49 MB (0.0%)
Gzip Size 5.35 KB (0.0%) 107.12 KB (0.0%) 107.43 KB (0.0%) 108.81 KB (0.0%) 122.75 KB (0.0%) 145.39 KB (0.0%) 52.15 KB (0.0%) 9.92 MB (0.0%)
Compile Time 0.8 s (0.0%) 2.8 s (0.0%) 2.7 s (0.0%) 2.5 s (0.0%) 2.8 s (0.0%) 3.0 s (0.0%) 2.2 s (0.0%) 3.7 s (0.0%)

@zhpenkov zhpenkov requested a review from Copilot January 27, 2026 09:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the test suite from Jest to Vitest, a modern and faster test runner with better ESM support. The migration updates all test configurations, test imports, and custom reporters while maintaining existing test functionality.

Changes:

  • Replaced Jest with Vitest across all test files and configurations
  • Migrated custom specificity reporter from Jest to Vitest API
  • Updated test imports from @jest/globals to vitest
  • Modified TypeScript configuration for better ESM compatibility

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
units/vitest.config.ts New Vitest configuration for unit tests with jsdom environment
units/specificity-reporter.ts Converted custom reporter from Jest API to Vitest Reporter interface
units/specificity-reporter.mjs Removed old Jest reporter implementation
units/jest.config.mjs Removed Jest configuration file
units/utility.ts Updated test imports from Jest to Vitest
units/tsconfig.json Changed moduleResolution to "bundler" and updated type definitions
units/specificity-analyzer.ts Added placeholder tests for empty selector cases and updated imports
units/package.json Updated test scripts to use Vitest commands
units/*/static.test.ts Updated imports to include Vitest test functions
units/*/specificity.test.ts Added describe import from Vitest
packages/html/vitest.config.ts New Vitest configuration for HTML package tests
packages/html/tests/spec-requirements.test.ts Converted to async/await ESM pattern with dynamic imports
packages/html/package.json Updated test scripts and replaced ts-jest with vitest
packages/html/jest.config.js Removed Jest configuration
package.json Replaced Jest dependencies with Vitest and jsdom

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated no new comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 25 changed files in this pull request and generated no new comments.

@epetrow epetrow requested a review from zhpenkov February 17, 2026 12:16
@epetrow epetrow requested a review from zhpenkov February 18, 2026 11:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 25 changed files in this pull request and generated 7 comments.

Comments suppressed due to low confidence (1)

units/utility.ts:8

  • units is ESM (type: module), so __dirname is not defined at runtime under Vitest. This file uses __dirname to build themeDir/nodeModulesDir/distDir, which will crash the test suite. Derive __dirname from import.meta.url (or switch these path resolutions to use new URL() with import.meta.url).
import { describe, it, expect } from "vitest";

const theme = process.env.THEME as string;
const themeDir = path.resolve(__dirname, "../packages", theme);
const themeScssDir = path.resolve(themeDir, "scss");

Copy link
Contributor

@zhpenkov zhpenkov left a comment

Choose a reason for hiding this comment

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

Looking good

@zhpenkov zhpenkov requested a review from a team February 19, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature of an existing functionality or an improvement of an existing functionality. Infrastructure Issues related overall infrastructure for build, test and deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants