chore: cxspa-13736 - migrate 14 remaining libs from karma to vitest - #21847
Open
SouhaibKhadraoui wants to merge 26 commits into
Open
chore: cxspa-13736 - migrate 14 remaining libs from karma to vitest#21847SouhaibKhadraoui wants to merge 26 commits into
SouhaibKhadraoui wants to merge 26 commits into
Conversation
…ng libs : organization, pdf-invoices, pickup-in-store, product, product-configurator, product-multi-dimensional, qualtrics, quote, requested-delivery-date, smartedit, storefinder, subscription-billing, tracking, user
…. gitignore updated to exclude workflow files
…iles - still some minor failures to tackle, but mostly done
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…e week, others due to circular import dependencies or wrong pathing resolutions, fixed most of them
…st in product-image-zoom-view.component.spec.ts
ercultimate
reviewed
Aug 20, 2026
SouhaibKhadraoui
force-pushed
the
chore/CXSPA-13736
branch
from
August 20, 2026 19:17
1e9d640 to
f2529c8
Compare
…ased/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.spec.ts
SouhaibKhadraoui
marked this pull request as ready for review
August 24, 2026 15:30
spartacus
|
||||||||||||||||||||||||||||
| Project |
spartacus
|
| Branch Review |
chore/CXSPA-13736
|
| Run status |
|
| Run duration | 05m 27s |
| Commit |
|
| Committer | SouhaibKhadraoui |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
4
|
|
|
0
|
|
|
0
|
|
|
103
|
| View all changes introduced in this branch ↗︎ | |
SouhaibKhadraoui
marked this pull request as ready for review
August 24, 2026 16:10
SouhaibKhadraoui
marked this pull request as ready for review
August 24, 2026 17:54
SouhaibKhadraoui
marked this pull request as ready for review
August 24, 2026 20:35
BenjaminEmiliani
approved these changes
Aug 24, 2026
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.
Vitest Migration Report — CXSPA-13736
Branch:
chore/CXSPA-13736vsdevelopScope
15 libraries migrated from Karma/Jasmine to Vitest across 638 spec files and 85 config/infrastructure files.
core-libs/corefeature-libs/organizationfeature-libs/product-configuratorfeature-libs/userfeature-libs/quotefeature-libs/pickup-in-storefeature-libs/storefinderfeature-libs/subscription-billingfeature-libs/productfeature-libs/requested-delivery-datefeature-libs/pdf-invoicesfeature-libs/smarteditfeature-libs/trackingfeature-libs/product-multi-dimensionalfeature-libs/qualtricsInfrastructure Changes
Files added (per library)
vitest.config.ts— 15 new configs (one per library)Files deleted (per library)
karma.conf.js— 15 removedtest.ts(Karma entry point) — 14 removed (all feature-libs;core-libs/coredid not have one)Config pattern (
vitest.config.ts)All configs follow a consistent shape:
core-libs/coreuses the base config (noresolve.aliasblock needed). Feature-libs that reference non-barrel monorepo paths add explicitresolve.aliasentries to work around Vite's module resolution.project.jsonchanges (per library)The
testtarget (Karma executor) was renamed totest-vitestand switched tonx:run-commands:ci-scripts/unit-tests.shTwo new shell functions added:
Both
run_all_unit_testsandrun_affected_unit_testsnow call the corresponding Vitest function after their Jasmine/Jest steps.Spec File Fixes Applied
jasmine.createSpy()/jasmine.createSpyObj()→vi.fn()vi.fn()lines added.and.returnValue()/.and.callFake()/.and.callThrough()→.mockReturnValue()/.mockImplementation()import createSpy = jasmine.createSpy→import { vi } from 'vitest'spyOnProperty(obj, 'prop')→vi.spyOn(obj, 'prop', 'get')vi.spyOn(...'get')addedspyOnPropertyis Jasmine-only; replaced with Vitest accessor spy.toBeTrue()/.toBeFalse()→.toBe(true)/.toBe(false)jasmine.objectContaining({})→expect.objectContaining({})jasmine.any(Type)→expect.any(Type).nativeElement.innerText→.nativeElement.textContentinnerTextis not implemented in jsdom;textContent(with optional.trim()) used insteadvi.useFakeTimers()/vi.useRealTimers()bracketsuseFakeTimers/ 44useRealTimerscalls addedvi.advanceTimersByTimeAsyncrequire explicit fake timer setup/teardownjasmine.SpyObj<T>type annotation → removed / retypedReturnType<typeof vi.spyOn>where neededNo residual
jasmine.*references remain in any added lines — the migration is clean with respect to Jasmine API surface.Vitest Config Notes
pool: 'forks'— uses child processes instead of threads, required for Angular's zone.js compatibility under jsdom.globals: true— exposesdescribe,it,expect,beforeEach,afterEachetc. globally so spec files do not need explicit imports for those.setupFiles: ['../../testing/setup-vitest.ts']— shared setup file (pre-existing from earlier migrations) configures jsdom globals, zone.js, and Angular TestBed teardown.resolve.alias— feature-libs with deep cross-lib imports (e.g.organization) map non-resolvable paths to their.tssource files directly.core-libs/coredoes not need this.Summary
karma.conf.jsdeletedtest.tsentry points deletedvitest.config.tsaddedproject.jsontargets updatedvi.*calls introduced