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

[test] Include module augmentation for Chai custom matchers #3754

Merged
merged 3 commits into from
Jan 27, 2022

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented Jan 27, 2022

In the core repo, test/utils/initMatchers.ts is within the baseUrl of the root tsconfig.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 each tsconfig.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.

@mui-bot
Copy link

mui-bot commented Jan 27, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 225.2 596.8 276.2 331.26 134.896
Sort 100k rows ms 553.9 1,027.7 576.3 739.3 179.945
Select 100k rows ms 168.5 271.5 199.9 217.02 40.214
Deselect 100k rows ms 124.7 546.2 152.3 230.82 158.707

Generated by 🚫 dangerJS against 5a960ba

@@ -4,5 +4,5 @@
"noEmit": true,
"types": ["mocha", "node", "chai", "chai-dom"]
},
"include": ["src"]
"include": ["src", "../../../node_modules/@mui/monorepo/test/utils/initMatchers.ts"]
Copy link
Member

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 ?

Copy link
Member Author

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

@github-actions
Copy link

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

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 27, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 27, 2022
@@ -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();
Copy link
Member Author

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.

@m4theushw m4theushw marked this pull request as ready for review January 27, 2022 16:25
Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

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

Nice!

@cherniavskii cherniavskii merged commit a39578c into mui:master Jan 27, 2022
@m4theushw m4theushw deleted the chai-custom-matchers branch January 27, 2022 20:23
@cherniavskii cherniavskii added core Infrastructure work going on behind the scenes test labels Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants