Merge branch 'backstage:master' into master

This commit is contained in:
Ambrish R
2025-06-02 18:46:31 +05:30
committed by GitHub
2 changed files with 10 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Only use the caching Jest module loader for frontend packages in order to avoid breaking real ESM module imports.
+5 -4
View File
@@ -212,6 +212,11 @@ function getRoleConfig(role, pkgJson) {
if (FRONTEND_ROLES.includes(role)) {
return {
testEnvironment: require.resolve('jest-environment-jsdom'),
// The caching module loader is only used to speed up frontend tests,
// as it breaks real dynamic imports of ESM modules.
runtime: envOptions.oldTests
? undefined
: require.resolve('./jestCachingModuleLoader'),
transform,
};
}
@@ -257,10 +262,6 @@ async function getProjectConfig(targetPath, extraConfig, extraOptions) {
// A bit more opinionated
testMatch: [`**/*.test.{${SRC_EXTS.join(',')}}`],
runtime: envOptions.oldTests
? undefined
: require.resolve('./jestCachingModuleLoader'),
transformIgnorePatterns: [`/node_modules/(?:${transformIgnorePattern})/`],
...getRoleConfig(pkgJson.backstage?.role, pkgJson),
};