cli: fix for ts-jest config not being applied

This commit is contained in:
Patrik Oldsberg
2020-10-31 11:46:25 +01:00
parent a9ae9b7504
commit 64df8d7d8e
+7 -4
View File
@@ -77,14 +77,17 @@ async function getConfig() {
'\\.(css|less|scss|sss|styl)$': require.resolve('jest-css-modules'),
},
globals: {
'ts-jest': {
isolatedModules: true,
},
},
// We build .esm.js files with plugin:build, so to be able to load these in tests they need to be transformed
// TODO: jest is working on module support, it's possible that we can remove this in the future
transform: {
'\\.esm\\.js$': require.resolve('jest-esm-transformer'),
'\\.(js|jsx|ts|tsx)$': [
require.resolve('ts-jest'),
{ isolatedModules: true },
],
'\\.(js|jsx|ts|tsx)$': require.resolve('ts-jest'),
'\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg)$': require.resolve(
'./jestFileTransform.js',
),