Skip to content

[code-infra] Replace mocha with vitest on e2e and regression tests #18071

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

Merged
merged 18 commits into from
Jun 2, 2025

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented May 30, 2025

Plan

Will try to remove mocha types in a final PR

@JCQuintas JCQuintas self-assigned this May 30, 2025
@JCQuintas JCQuintas added core Covers general upkeep, such as minor refactoring, typo fixes, or structural changes. scope: code-infra labels May 30, 2025
Copy link

github-actions bot commented May 30, 2025

Thanks for adding a type label to the PR! 👍

@JCQuintas JCQuintas added the type: enhancement This is not a bug, nor a new feature label May 30, 2025
@mui-bot
Copy link

mui-bot commented May 30, 2025

Deploy preview: https://deploy-preview-18071--material-ui-x.netlify.app/

Bundle size report

Total Size Change: 0B(0.00%) - Total Gzip Change: 0B(0.00%)
Files: 120 total (0 added, 0 removed, 0 changed)

Details of bundle changes

Generated by 🚫 dangerJS against c55502a

@JCQuintas JCQuintas changed the title [code-infra] Remove mocha from e2e test [code-infra] Replace mocha with vitest on e2e tests May 30, 2025
@JCQuintas JCQuintas requested a review from a team May 30, 2025 17:28
@JCQuintas JCQuintas marked this pull request as ready for review May 30, 2025 17:37
@JCQuintas JCQuintas changed the title [code-infra] Replace mocha with vitest on e2e tests [code-infra] Replace mocha with vitest on e2e and regression tests May 31, 2025
@@ -6,6 +6,34 @@ import react from '@vitejs/plugin-react';
const CURRENT_DIR = dirname(fileURLToPath(import.meta.url));
const WORKSPACE_ROOT = resolve(CURRENT_DIR, './');

export const alias = [
Copy link
Member

@Janpot Janpot Jun 2, 2025

Choose a reason for hiding this comment

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

How do you feel about vite-tsconfig-paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing against it if it works. I can try it in a different pr

@JCQuintas JCQuintas requested a review from Janpot June 2, 2025 09:54
"mocha": "mocha --config .mocharc.js '**/*.test.{js,ts,tsx}'",
"server": "serve . -p 5001"
"test": "vitest",
"server": "serve . -L -p 5001"
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this -L flag? Is it a leftover from tests you made or is it mean to be kept?

Copy link
Member Author

Choose a reason for hiding this comment

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

-L is to omit the server logs, which make the CI logs very verbose. We generally want to know if the tests passed or if there was an error on them, not that the server is working as expected.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense 👍

Comment on lines +26 to +27
testTimeout: 20000,
hookTimeout: 20000,
Copy link
Member

Choose a reason for hiding this comment

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

We also seem to be setting timeouts in line 112 of index.test.ts. Would it make sense to move all the timeout set up here so that it's centralized?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly these are different timeouts, one is vitest, another is playwright 🫠

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Great work! 👍
Did you try also removing the mocha dep? 🤔

@JCQuintas
Copy link
Member Author

Great work! 👍 Did you try also removing the mocha dep? 🤔

not yet, was going to work on it next 😅

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 2, 2025
Copy link

github-actions bot commented Jun 2, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 2, 2025
@JCQuintas JCQuintas enabled auto-merge (squash) June 2, 2025 11:07
@JCQuintas JCQuintas merged commit 34868a8 into mui:master Jun 2, 2025
21 checks passed
@JCQuintas JCQuintas deleted the remove-mocha-e2e branch June 2, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Covers general upkeep, such as minor refactoring, typo fixes, or structural changes. type: enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants