Open
Conversation
Packages Report
|
Contributor
There was a problem hiding this comment.
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/globalstovitest - 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 |
40825a0 to
6726762
Compare
zhpenkov
reviewed
Feb 17, 2026
zhpenkov
reviewed
Feb 17, 2026
zhpenkov
reviewed
Feb 17, 2026
zhpenkov
reviewed
Feb 17, 2026
zhpenkov
reviewed
Feb 17, 2026
Contributor
There was a problem hiding this comment.
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
unitsis ESM (type: module), so__dirnameis not defined at runtime under Vitest. This file uses__dirnameto buildthemeDir/nodeModulesDir/distDir, which will crash the test suite. Derive__dirnamefromimport.meta.url(or switch these path resolutions to usenew URL()withimport.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");
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.
No description provided.