-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[test] Include module augmentation for Chai custom matchers #3754
Conversation
These are the results for the performance tests:
|
@@ -4,5 +4,5 @@ | |||
"noEmit": true, | |||
"types": ["mocha", "node", "chai", "chai-dom"] | |||
}, | |||
"include": ["src"] | |||
"include": ["src", "../../../node_modules/@mui/monorepo/test/utils/initMatchers.ts"] |
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.
Is there something preventing us from adding it to the root tsconfig.json
file of the repo ?
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.
Yes, include
in the root tsconfig.json
gets overwritten by the package tsconfig.json
when extending. https://www.typescriptlang.org/tsconfig#extends
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@@ -116,8 +116,7 @@ describe('<DataGrid /> - Cells', () => { | |||
fireEvent.click(getCell(0, 0)); | |||
|
|||
expect(() => { | |||
fireEvent.focus(getCell(1, 0)); | |||
// @ts-expect-error need to migrate helpers to TypeScript | |||
getCell(1, 0).focus(); |
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.
I changed to fireEvent
by mistake in #3752.
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.
Nice!
In the core repo,
test/utils/initMatchers.ts
is within thebaseUrl
of the roottsconfig.json
, so the module augmentation also gets included. In the X repo, this file is not part of the root directory. It's only included when running the tests, so the TypeScript compiler can't see the new types. My solution was to explicitly include the file in eachtsconfig.json
. It had to be done in each config because of the way that TypeScript handles config inheritance.The monorepo was updated to get mui/material-ui#30798.