test: migrate from stencil jest test runner to vitest#973
Merged
glushkova91 merged 17 commits intomainfrom May 10, 2026
Merged
Conversation
added 8 commits
April 23, 2026 22:24
# Conflicts: # pnpm-lock.yaml
There was a problem hiding this comment.
Pull request overview
Migrates the Stencil spec test setup in core/ from the legacy Jest-based runner to @stencil/vitest, updates Stencil core to a newer version, and adjusts unit tests/configuration accordingly (including a pnpm patch to improve ElementInternals mocking in mock-doc).
Changes:
- Replace
stencil test --spec(Jest) withstencil-test(Vitest) and add Vitest config + setup shims. - Update many spec tests from
newSpecPage()/jest.*to@stencil/vitestrender()/vi.*. - Upgrade
@stencil/coreand introduce pnpm patch to mockElementInternals.attachInternals()for spec tests.
Reviewed changes
Copilot reviewed 50 out of 52 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| react/package.json | Remove React wrapper Jest deps/config |
| package.json | Update pnpm patchedDependencies to Stencil 4.43.3 |
| patches/@stencil__core@4.42.0.patch | Add ElementInternals mock patch (unused mapping) |
| patches/@stencil__core@4.43.3.patch | Add ElementInternals mock patch (active mapping) |
| patches/@stencil__core@4.43.4.patch | Add ElementInternals mock patch (unused mapping) |
| core/package.json | Switch test scripts to stencil-test, add Vitest deps, set type: module |
| core/vitest.config.ts | Add Vitest configuration for Stencil environment |
| core/vitest-setup-plugin.ts | Add global DOM API shims for tests |
| core/stencil.transformer.js | Remove Jest asset transformer |
| core/stencil.config.ts | Remove Jest testing config block |
| core/setupTests.js | Remove Jest setup file |
| core/eslint.config.js | Convert ESLint config to ESM + update ignores |
| core/src/utils/media-matcher.spec.ts | Migrate Jest mocks to Vitest |
| core/src/components/cat-alert/cat-alert.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-avatar/cat-avatar.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-badge/cat-badge.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-button/cat-button.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-button-group/cat-button-group.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-card/cat-card.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-checkbox/cat-checkbox.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-date/cat-date.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-date-inline/cat-date-inline.spec.tsx | Migrate to Vitest + render() and mock i18n |
| core/src/components/cat-datepicker/readme.md | Regenerated docs table formatting/types |
| core/src/components/cat-datepicker/cat-datepicker.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-datepicker-inline/cat-datepicker-inline.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-dropdown/cat-dropdown.spec.tsx | Migrate to Vitest + update mocks/async waits |
| core/src/components/cat-form-group/cat-form-group.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-form-hint/cat-form-hint.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-i18n/cat-i18n-registry.spec.tsx | Add Vitest imports |
| core/src/components/cat-icon/cat-icon.spec.tsx | Migrate to Vitest + render() and mock registry |
| core/src/components/cat-icon/cat-icon-registry.spec.tsx | Add Vitest imports |
| core/src/components/cat-input/cat-input.spec.tsx | Migrate to Vitest + render() and mock i18n |
| core/src/components/cat-menu/cat-menu.spec.tsx | Migrate to Vitest + render() and update mocks |
| core/src/components/cat-menu-item/cat-menu-item.spec.tsx | Migrate to Vitest + render() and focus spies |
| core/src/components/cat-notification/cat-notification.spec.tsx | Add Vitest imports |
| core/src/components/cat-pagination/cat-pagination.spec.tsx | Migrate to Vitest + render() and mock i18n |
| core/src/components/cat-radio/cat-radio.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-radio-group/cat-radio-group.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-scrollable/cat-scrollable.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-select/cat-select.spec.tsx | Migrate to Vitest + render() and hoisted mocks |
| core/src/components/cat-skeleton/cat-skeleton.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-spinner/cat-spinner.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-tab/cat-tab.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-tabs/cat-tabs.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-tag/cat-tag.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-textarea/cat-textarea.spec.tsx | Migrate to Vitest + render() and mock i18n |
| core/src/components/cat-time/cat-time.spec.tsx | Migrate to Vitest + render() and mock i18n |
| core/src/components/cat-time/cat-time-locale.spec.ts | Replace fdescribe with describe + Vitest import |
| core/src/components/cat-toggle/cat-toggle.spec.tsx | Migrate to Vitest + render() |
| core/src/components/cat-tooltip/cat-tooltip.spec.tsx | Migrate to Vitest + render() |
| core/src/components.d.ts | Regenerated Stencil component typings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 4 commits
May 10, 2026 21:09
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.