Migrate unit tests from Jasmine/Karma to a modern stack
Los mantenedores suelen responder en 1 día
@alexandrevryghem ya está trabajando en esto.
Desde el 2/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Is your feature request related to a problem? Please describe.
Upgrade to Angular v18 was finalized in DSpace 9.0 (DSpace/dspace-angular#3304). However, Jasmine/Karma is still used for unit tests but, as noted in the issue, Karma is deprecated.
Angular v21 declared stable support for Vitest. This is also the Angular team's default choice for new projects in v21+ (moreover, Angular team also provided a guide on Migrating from Karma to Vitest, so the migration can be semi-automated.)
I'd like us to discuss and plan a migration away from Karma to a modern test runner. From what I can see, the most commonly mentioned options are:
- Vitest (default in Angular >=v21)
- Jest (has been around longer)
- Web Test Runner (runs tests in a real browser rather than Node/jsdom)
Vitest and Jest are both a test runner and a testing library, so they replace both Karma + Jasmine stack. Web Test Runner replaces only Karma (uses bult-in Mocha framework support, but has Jasmine adapter web-test-runner-jasmine).
Also, check out Vitest's Comparisons with Other Test Runners page.
What about Jasmine? Cypress?
Just to avoid confusion: Karma is only the test runner (it launches the browser and reports results). Jasmine is the testing framework we actually write tests with (spyOn etc.).
Both Vitest and Jest support Jasmine-style syntax (and maintain compatibility with most Jasmine functions)
We also use Cypress as the e2e tool (so it's not related to unit tests)
- To learn more, see also Vitest's comparison Cypress section
Describe the solution you'd like
This ticket is to discuss and plan a migration away from Karma.
Describe alternatives or workarounds you've considered
We are currently still using Karma via @angular-devkit/build-angular and @angular-builders/custom-webpack:karma. This works for now, but it depends on a deprecated package
Changing the unit test runner while on Angular v20 could make a future v21 upgrade smoother
Additional information
Karma/Jasmine and Angular Timeline
- Angular v16 declared that Karma was deprecated.
- This version added experimental support for Jest, and Web Test Runner [source]
- Angular v20 added experimental support for Vitest [source]
- Angular v21 declared Vitest as the primary test runner (and stable), replacing Karma [source]
- Before v21, however, it wasn't clear which runner Angular would ultimately favor. For example this great comment from Angular team developer suggested that Angular was really fond of supporting Jest
Vitest has gained significant traction recently. According to npm trends, Vitest downloads surpassed Jest around April 2026, and now seem to be 2x higher (Jest was first published in NPM 15 years ago, Vitest 5 years ago).
Questions for the Community
- Any strong opinions (for or against) any particular test runner?
- Any other alternatives we should consider?
- Has anyone already migrated a large Angular project from Karma? If so, what challenges did you face?
- Does anyone have experience with Vitest in a large Angular monorepo?
- Are there any DSpace-specific testing needs that might complicate migration?
References
- DSpace/dspace-angular#3304
- Vitest's Comparisons with Other Test Runners
- Angular's Migrating from Karma to Vitest Guide
- https://github.com/angular/angular-cli/issues/25217#issuecomment-1581581005
- Medium post comparing Jest and Vitest
- NPM Trends (in case of 404 error, please go directly to npmtrends.com and select packages manually)
Additional sources not directly mentioned in this issue:
- https://github.com/DSpace/dspace-angular/issues/2 - test stack original issue in DSpace/dspace-angular
- In Jest, default JS runner can be replaced with fast Rust-based SWC
- This post goes more into details on migrating from Karma to Vitest
- Angular Roadmap
- Lenguaje dominante
- TypeScript
- Estrellas
- 180
- Forks
- 577
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 100
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DSpace/dspace-angular
-
accessibility affects: 10.x affects: main bug ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DSpace/dspace-angular#6531 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
accessibility affects: 10.x affects: main bug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
DSpace/dspace-angular#6530 ·
Los mantenedores suelen responder en 1 día
-
Submission Form Allows Deletion of All Repeating Item EntriesPosiblemente ocupada @Rowan-McKereghan la tomó hace 5 días. Abiertoaffects: 8.x affects: 9.x bug component: submission
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DSpace/dspace-angular#6511 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Visual issues with qualdrop fieldsPosiblemente ocupada @DanGastardelli la tomó hace 15 días. Abiertoaffects: 10.x affects: 9.x bug claimed: Acervos Digitais component: submission Difficulty: Low ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
DSpace/dspace-angular#6412 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Facet headings have incorrect clickable area to expand/collapsePosiblemente ocupada @jesielviana la tomó hace 12 días. Abiertoaccessibility affects: 10.x affects: 8.x affects: 9.x bug ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DSpace/dspace-angular#6364 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de DSpace/dspace-angular
Issues similares
-
bug parity
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
WenyuChiou/agent-board#1489 ·
Los mantenedores suelen responder en 1 día
-
area: bazaar bug complexity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
accensa/x402-facilitator-stellar#779 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue P4 size:S web-ui
Dificultad 2/5 Medio día Aptitud para principiantes 85/100
josephfung/curia#2600 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cloudflare/partykit#444 ·