mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix test_build_devtools CI job to run test-build-devtools (#17631)
* Skip abandoned project folders in Jest config This fixes a problem that occurs after renaming a package. * Fix test_build_devtools to run test-build-devtools * Exclude console.error plugin for DevTools packages * Use correct release channel for DevTools tests This should fix the createRoot error. * Fix TZ dependent test * Change DT job dependencies
This commit is contained in:
committed by
Brian Vaughn
parent
7c21bf72ac
commit
36a6e29bb3
@@ -14,7 +14,13 @@ const packages = readdirSync(packagesRoot).filter(dir => {
|
||||
return false;
|
||||
}
|
||||
const packagePath = join(packagesRoot, dir, 'package.json');
|
||||
return statSync(packagePath).isFile();
|
||||
let stat;
|
||||
try {
|
||||
stat = statSync(packagePath);
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return stat.isFile();
|
||||
});
|
||||
|
||||
// Create a module map to point React packages to the build output
|
||||
|
||||
@@ -11,7 +11,13 @@ const packages = readdirSync(packagesRoot).filter(dir => {
|
||||
return false;
|
||||
}
|
||||
const packagePath = join(packagesRoot, dir, 'package.json');
|
||||
return statSync(packagePath).isFile();
|
||||
let stat;
|
||||
try {
|
||||
stat = statSync(packagePath);
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return stat.isFile();
|
||||
});
|
||||
|
||||
// Create a module map to point React packages to the build output
|
||||
|
||||
@@ -68,11 +68,14 @@ module.exports = {
|
||||
// for test files, we also apply the async-await transform, but we want to
|
||||
// make sure we don't accidentally apply that transform to product code.
|
||||
const isTestFile = !!filePath.match(/\/__tests__\//);
|
||||
const isInDevToolsPackages = !!filePath.match(
|
||||
/\/packages\/react-devtools.*\//
|
||||
);
|
||||
const testOnlyPlugins = [pathToBabelPluginAsyncToGenerator];
|
||||
const sourceOnlyPlugins =
|
||||
process.env.NODE_ENV === 'development'
|
||||
? [pathToBabelPluginReplaceConsoleCalls]
|
||||
: [];
|
||||
const sourceOnlyPlugins = [];
|
||||
if (process.env.NODE_ENV === 'development' && !isInDevToolsPackages) {
|
||||
sourceOnlyPlugins.push(pathToBabelPluginReplaceConsoleCalls);
|
||||
}
|
||||
const plugins = (isTestFile ? testOnlyPlugins : sourceOnlyPlugins).concat(
|
||||
babelOptions.plugins
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user