-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[code-infra] Use vitest bundled types
#17758
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
Changes from all commits
fcf7cf9
bc4de0a
68b491e
3c8b4de
db58cad
7a38e0f
57fb81f
7bb30f7
89040f9
f38d5f2
1c32766
62cce28
dc4bf25
18fd0e7
4c1b312
762817d
a13a0e7
bf92ad1
68bc76c
6da444d
7039fe1
e48944b
0201cff
ead4fac
1020e6f
58700c3
6437c54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { expect } from 'chai'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is basically the main "noisy" change - relying on the bundled |
||
| import adapterDependencies from './adapter-dependencies.json'; | ||
| import { ADAPTER_TO_LIBRARY, postProcessImport } from './postProcessImport'; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,16 @@ | |
| "skipLibCheck": true, | ||
| "esModuleInterop": true, | ||
| "incremental": true, | ||
| "types": ["@mui/internal-test-utils/initMatchers", "chai-dom", "mocha"] | ||
| "types": ["@mui/internal-test-utils/initMatchers", "vitest/globals"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to note that this will add the globals to all docs code, even non-tests. Ideally we have separate tsconfigs for tests and docs, perhaps explicitly importing them in test files could already remove a bit of this friction?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great point. 👍
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is what we had with mocha as well 🤷 I would be in favour of removing the globals and explicitly importing them, but mui/material code would cry
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I'm also for importing them explicitly |
||
| }, | ||
| "include": ["next-env.d.ts", "next.config.mjs", "docs-env.d.ts", "src", "pages/**/*.ts*", "data"], | ||
| "include": [ | ||
| "next-env.d.ts", | ||
| "next.config.mjs", | ||
| "docs-env.d.ts", | ||
| "src", | ||
| "pages/**/*.ts*", | ||
| "data", | ||
| "../test/utils/addChaiAssertions.ts" | ||
| ], | ||
| "exclude": ["docs/.next", "docs/export", "pages/playground"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,7 @@ | |
| "types": [ | ||
| "@mui/internal-test-utils/initMatchers", | ||
| "@mui/material/themeCssVarsAugmentation", | ||
| "chai-dom", | ||
| "mocha", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "vitest/globals", | ||
| "node" | ||
| ], | ||
| "noImplicitAny": false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { expect } from 'chai'; | ||
|
|
||
| /* | ||
| * This test verifies that these modules and types are exported correctly | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { expect } from 'chai'; | ||
|
|
||
| import { | ||
| scaleLinear, | ||
|
|
||
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.
Explicitly altering the test rules to avoid the need for eslint-plugin-mocha`, while monorepo still "mandates" it. 🙈
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.
Hopefully can be ditched once we move to flat config
Uh oh!
There was an error while loading. Please reload this page.
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.
👍 yeah, let's do a big overhaul once we go to flat config
cc @brijeshb42 just for visibility on this eslint config file. Could give ideas on how we optimally abstract our shared flat configs.
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.
Yeah. I already have some ideas for it.