feat: migrate to Vue 3 and Vue Test Utils v2#1875
Open
GerardoIbarra wants to merge 2 commits into
Open
Conversation
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.
This PR migrates the Vue-select library from Vue 2 to Vue 3, including updates to the core component, build configuration, and the entire test suite. The component is now fully compatible with the Vue 3 reactivity system and modern tooling.
Key Changes
Core Component ( Select.vue )
🟢 Renamed value prop to modelValue for Vue 3 v-model compatibility.
🟢 Updated event emissions:
- input→ update:modelValue.
🟢 Replaced $scopedSlots with $slots (unified slots API).
🟢 Added explicit emits declaration for all internal events.
🟢 Updated dynamic ref handling for v-for loops (deselect buttons).
Test Infrastructure
🟢 Migrated from vue-jest to @vue/vue3-jest and updated babel-jest.
🟢 Updated
tests/helpers.js
to use createApp and h instead of the global Vue instance.
🟢 Refactored all 22 test suites (174 tests) to use Vue 3 compatible syntax and selectors.
🟢 Migrated slot tests to the new function-based render API.
Build & Tooling
🟢 Replaced .babelrc with babel.config.js for better Jest compatibility.
🟢 Updated Webpack aliases to use the Vue 3 ESM bundler.
🟢 Updated package.json dependencies:
- vue(^3.5),
- @vue/test-utils (^2.4),
- and added @vue/compiler-sfc.
Verification Results
✅ Unit Tests: 100% test suites passing (172 passed, 2 skipped due to JSDOM environment limitations).
✅ Dev Server: Verified working via npm run serve.
✅ Build: Production build completes successfully.
Breaking Changes