Skip to content

Conversation

@Janpot
Copy link
Member

@Janpot Janpot commented Dec 4, 2025

Makes it possible to iterate faster on this module, the goal is to thin it out and remove unnecessary wrapper APIs.

in this PR I also make emotion optional for createRenderer

@oliviertassinari oliviertassinari temporarily deployed to test-utils - mui-tools-public PR #927 December 4, 2025 11:59 — with Render Destroyed
@Janpot Janpot added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Dec 4, 2025
@mui-bot
Copy link

mui-bot commented Dec 4, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Janpot Janpot requested review from a team and michaldudak December 4, 2025 15:58
@Janpot Janpot requested a review from Copilot December 4, 2025 17:10
Copilot finished reviewing on behalf of Janpot December 4, 2025 17:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces the @mui/internal-test-utils package to the code-infra repository, consolidating testing utilities to enable faster iteration and development. The package provides a comprehensive suite of test utilities including renderers, matchers, conformance testing, and helper functions for React component testing.

Key Changes

  • New test-utils package with complete TypeScript and Vitest configuration
  • Custom chai matchers for accessibility, focus, and style assertions
  • Conformance testing framework for component consistency
  • React Testing Library wrapper with enhanced functionality

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/test-utils/package.json Package definition with dependencies and exports for the new test utilities
packages/test-utils/tsconfig.json TypeScript configuration for the test-utils package
packages/test-utils/tsconfig.build.json Build-specific TypeScript configuration
packages/test-utils/vitest.config.mts Vitest test configuration with jsdom environment setup
packages/test-utils/src/index.ts Main entry point exporting all test utilities
packages/test-utils/src/setupVitest.ts Vitest setup with console error/warning suppression
packages/test-utils/src/setupVitestBrowser.ts Browser environment setup with Touch API polyfill
packages/test-utils/src/initMatchers.ts Initializes chai matchers for tests
packages/test-utils/src/initMatchers.test.js Test suite for custom error/warning matchers
packages/test-utils/src/initPlaywrightMatchers.ts Playwright-specific matchers for browser testing
packages/test-utils/src/chaiPlugin.ts Custom chai assertions for accessibility and styling
packages/test-utils/src/chai.types.ts TypeScript type definitions for custom chai matchers
packages/test-utils/src/createRenderer.tsx Enhanced React Testing Library renderer with emotion cache
packages/test-utils/src/createRenderer.test.jsx Tests for the custom renderer functionality
packages/test-utils/src/createDescribe.ts Utility for creating describe blocks with skip/only support
packages/test-utils/src/describeConformance.tsx Comprehensive conformance testing framework for components
packages/test-utils/src/components.tsx Test helper components (ErrorBoundary, RenderCounter)
packages/test-utils/src/focusVisible.ts Focus management utilities for testing
packages/test-utils/src/flushMicrotasks.ts Async utility for flushing microtasks
packages/test-utils/src/fireDiscreteEvent.ts Discrete event firing utilities for React 17/18 compatibility
packages/test-utils/src/env.ts Environment detection utilities
packages/code-infra/src/eslint/material-ui/config.mjs ESLint configuration update to support .jsx extension

@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 6, 2025

Adopt @mui/internal-test-utils
Makes it possible to iterate faster on this module

OK, so @mui/internal-test-utils is currently owned by https://github.com/mui/material-ui.

Intuitively, I would expect https://github.com/mui/base-ui to be where we can iterate the fastest with this logic, because it covers 80%+ of the test cases for this test utils package, and allows an instant deployment experience against those tests. So wouldn't it be the best place to host those internal modules?

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 8, 2025
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 Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants