Fix some DevTools regression test actions and assertions (#34459)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2025-09-15 15:31:58 +02:00
committed by GitHub
parent 47664deb8e
commit 3fa927b674
8 changed files with 342 additions and 145 deletions

View File

@@ -80,7 +80,19 @@ module.exports = {
// This is only for React DevTools tests with React 16.x
// `react/jsx-dev-runtime` and `react/jsx-runtime` are included in the package starting from v17
if (semver.gte(ReactVersionTestingAgainst, '17.0.0')) {
// Technically 16.14 and 15.7 have the new runtime but we're not testing those versions.
if (
semver.gte(ReactVersionTestingAgainst, '15.0.0') &&
semver.lt(ReactVersionTestingAgainst, '17.0.0')
) {
plugins.push(
[
require.resolve('@babel/plugin-transform-react-jsx'),
{runtime: 'classic'},
],
require.resolve('@babel/plugin-transform-react-jsx-source')
);
} else {
plugins.push([
process.env.NODE_ENV === 'development'
? require.resolve('@babel/plugin-transform-react-jsx-development')
@@ -89,11 +101,6 @@ module.exports = {
// would be React.createElement.
{runtime: 'automatic'},
]);
} else {
plugins.push(
require.resolve('@babel/plugin-transform-react-jsx'),
require.resolve('@babel/plugin-transform-react-jsx-source')
);
}
plugins.push(pathToTransformLazyJSXImport);