-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[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
Conversation
Thanks for adding a type label to the PR! 👍 |
Deploy preview: https://deploy-preview-18071--material-ui-x.netlify.app/ Bundle size reportTotal Size Change: 0B(0.00%) - Total Gzip Change: 0B(0.00%) |
mocha
with vitest
on e2e tests
Signed-off-by: Jose C Quintas Jr <[email protected]>
mocha
with vitest
on e2e testsmocha
with vitest
on e2e and regression tests
@@ -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 = [ |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
"mocha": "mocha --config .mocharc.js '**/*.test.{js,ts,tsx}'", | ||
"server": "serve . -p 5001" | ||
"test": "vitest", | ||
"server": "serve . -L -p 5001" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
testTimeout: 20000, | ||
hookTimeout: 20000, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🫠
There was a problem hiding this 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? 🤔
not yet, was going to work on it next 😅 |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Jose C Quintas Jr <[email protected]>
Plan
Will try to remove mocha types in a final PR