cli: explicit jest env resolution
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
The built-in Jest configuration now always uses the Jest environments that are bundled with the CLI by default. This avoids a situation where Jest potentially picks up an incompatible version of the environment package from a different dependency in the project.
|
||||
@@ -54,14 +54,14 @@ function getRoleConfig(role) {
|
||||
case 'common-library':
|
||||
case 'frontend-plugin':
|
||||
case 'frontend-plugin-module':
|
||||
return { testEnvironment: 'jsdom' };
|
||||
return { testEnvironment: require.resolve('jest-environment-jsdom') };
|
||||
case 'cli':
|
||||
case 'backend':
|
||||
case 'node-library':
|
||||
case 'backend-plugin':
|
||||
case 'backend-plugin-module':
|
||||
default:
|
||||
return { testEnvironment: 'node' };
|
||||
return { testEnvironment: require.resolve('jest-environment-node') };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user