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

[code-infra] Changes for test util to work in vitest #43625

Open
wants to merge 50 commits into
base: master
Choose a base branch
from

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Sep 5, 2024

Related to mui/mui-x#14508

Help toward mui/mui-public#170

@JCQuintas JCQuintas added test scope: code-infra Specific to the core-infra product labels Sep 5, 2024
@JCQuintas JCQuintas self-assigned this Sep 5, 2024
@mui-bot
Copy link

mui-bot commented Sep 5, 2024

Netlify deploy preview

https://deploy-preview-43625--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 4eef12a

@oliviertassinari oliviertassinari changed the title [code-infra] changes for test util to work in vitest [code-infra] Changes for test util to work in vitest Sep 11, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 12, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 13, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 27, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 9, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 9, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 9, 2024
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Oct 14, 2024
@@ -28,13 +28,15 @@ import { EventHandlers } from '../utils/types';
const EMPTY_OBJECT = {};
const NOOP = () => {};

const defaultItemComparer = <ItemValue>(optionA: ItemValue, optionB: ItemValue) =>
optionA === optionB;
function defaultItemComparer<ItemValue>(optionA: ItemValue, optionB: ItemValue) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this related to vitest changes?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, vitest can't execute jsx in js files. There's a workaround, but you have to have every file interpreted as jsx. That unfortunately breaks this code.

@@ -932,7 +932,7 @@ describe('Joy <Autocomplete />', () => {
it('should ignore keydown event until the IME is confirmed', function test() {
// TODO: Often times out in Firefox 78.
// Is this slow because of testing-library or because of the implementation?
this.timeout(4000);
this?.timeout?.(4000);
Copy link
Member

Choose a reason for hiding this comment

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

Is vitest fast enough that we don't need an increased timeout?

Copy link
Member

Choose a reason for hiding this comment

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

Haven't seen it timeout yet. Will add it back for vitest if it's a problem. Otherwise we'll remove this altogether

@@ -0,0 +1,9 @@
// Shim for vitest describe.skipIf to be able to run mocha and vitest side-by-side
// TODO: Remove after migration to vitest is complete
const describeSkipIf: (condition: boolean) => Mocha.PendingSuiteFunction =
Copy link
Member

Choose a reason for hiding this comment

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

I hope it's just temporary, as the name is terrible :)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we'll turn this into describe.skipIf once we're away from mocha. There is no way to monkey patch in mocha, they don't expose these in the setup files

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 17, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: out-of-date The pull request has merge conflicts and can't be merged scope: code-infra Specific to the core-infra product test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants