Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration jest => vitest WIP #4806

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Migration jest => vitest WIP #4806

wants to merge 16 commits into from

Conversation

Shamzic
Copy link
Contributor

@Shamzic Shamzic commented Jan 16, 2025

Suite aux difficulté de compatibilité de Jest avec la version de vue 3.5, je propose de migrer les tests unitaires avec la lib Vitest qui me semble plus à jour et car c'est aussi la recommandation par défaut du framework.

À investiguer:

  • Deux tests sont exclus historiquement
  • Cette migration met en lumière des erreurs de description (d'où la limite de taille réhaussée temporairement pour passer outre)

@github-actions github-actions bot added this to the BC actuel milestone Jan 16, 2025
@Shamzic Shamzic changed the title Migration jest => vitest Migration jest => vitest WIP Jan 16, 2025
@Shamzic Shamzic force-pushed the migration-jest-into-vitest branch from 3314332 to cc3caad Compare January 16, 2025 13:31
@Shamzic Shamzic marked this pull request as ready for review January 28, 2025 13:22
@Shamzic Shamzic self-assigned this Jan 28, 2025
@Shamzic Shamzic requested a review from jenovateurs January 28, 2025 15:21
Copy link
Contributor

@jenovateurs jenovateurs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super travail, merci @Shamzic .
Juste quelques petites questions mais sur le fond ok.
Il y a aussi la question de la vulnérabilité avec glob mais bon c'est pour du test, ça devrait le faire.

@@ -109,7 +125,7 @@ describe("benefit descriptions", function () {
.replace(/\s\s+/g, " ")
.trim()
expect(innerText.length).toBeGreaterThanOrEqual(10)
expect(innerText.length).toBeLessThanOrEqual(420)
expect(innerText.length).toBeLessThanOrEqual(550)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu as fait un upgrade par rapport à mes aides vélos ?

environment: "jsdom",
include: ["tests/**/*.spec.ts"],
exclude: [
"tests/unit/views/fiscales.spec.ts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi les exclure ?

"test": "NODE_OPTIONS=--experimental-vm-modules NODE_PATH=. jest --testTimeout=20000",
"test": "NODE_OPTIONS='--max-old-space-size=4096' vitest run --pool=forks --poolOptions.threads.singleThread",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La commande ne fonctionne pas, j'ai du installer @vitest/ui mais il ne trouve pas la dépendance. Je propose de le supprimer

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