Skip to content

test: migrate from stencil jest test runner to vitest#973

Merged
glushkova91 merged 17 commits intomainfrom
feat/migrate-from-jest-to-vitest
May 10, 2026
Merged

test: migrate from stencil jest test runner to vitest#973
glushkova91 merged 17 commits intomainfrom
feat/migrate-from-jest-to-vitest

Conversation

@glushkova91
Copy link
Copy Markdown
Collaborator

No description provided.

@glushkova91 glushkova91 marked this pull request as ready for review April 23, 2026 20:22
Copy link
Copy Markdown

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

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) with stencil-test (Vitest) and add Vitest config + setup shims.
  • Update many spec tests from newSpecPage()/jest.* to @stencil/vitest render()/vi.*.
  • Upgrade @stencil/core and introduce pnpm patch to mock ElementInternals.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.

Comment thread core/package.json Outdated
Comment thread core/src/components/cat-input/cat-input.spec.tsx Outdated
Comment thread patches/@stencil__core@4.43.4.patch Outdated
Comment thread patches/@stencil__core@4.42.0.patch Outdated
Copy link
Copy Markdown

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 49 out of 51 changed files in this pull request and generated 3 comments.

Comment thread core/eslint.config.mjs
Comment thread core/src/components/cat-menu/cat-menu.spec.tsx
Comment thread core/src/components/cat-dropdown/cat-dropdown.spec.tsx
@glushkova91 glushkova91 merged commit 4053c7c into main May 10, 2026
9 checks passed
@glushkova91 glushkova91 deleted the feat/migrate-from-jest-to-vitest branch May 10, 2026 20:15
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