-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[core] Simplify testing architecture #6043
Conversation
These are the results for the performance tests:
|
@@ -1,3 +1,4 @@ | |||
require('@babel/register')({ | |||
extensions: ['.js', '.ts', '.tsx'], | |||
ignore: [/node_modules\/(?!@mui\/monorepo)/], |
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 had two babel files with almost the same config.
I removed the one in the old setup.js
file and used this one everywhere.
|
||
// The JSDOM implementation is too slow | ||
// https://github.com/jsdom/jsdom/issues/3234 | ||
window.getComputedStyle = function getComputedStyleMock() { |
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.
Copied from the old createDOM.js
file
Unify RFC template using core version
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
This comment was marked as outdated.
This comment was marked as outdated.
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.
Looks great!
packages/grid/x-data-grid-pro/src/tests/printExport.DataGrid.test.tsx
Outdated
Show resolved
Hide resolved
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Nice cleanup :) |
Use the
@mui/monorepo
setupJSDOM
file to avoid duplicating code (equivalent of our currentsetup.js
file which is badly named by the way).This has a side effect. The core adds the
url: 'http://localhost'
property to its JSDOM instance, which breaks our print tests becauseprintWindow.contentDocument.body
is now null (don't know why).If we don't find a fix, I can either copy / paste the
setupJSDOM
file to remove theurl
property or make it optional on the core, or skip the printing test when using JSDOM (what I currently did).Use the same file naming strategy as in the core
Set the license key before each test to prepare [license] Add new license status 'Out of scope' #5260 (comment)
Avoid mocha hook duplication (for example we had a
sinon.restore
on bothsetup.js
fortest:unit
and onkarma.test.js
fortest.karma
.