From 64df8d7d8e6310ceffd1a5652b1959159d84768f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 31 Oct 2020 11:46:25 +0100 Subject: [PATCH] cli: fix for ts-jest config not being applied --- packages/cli/config/jest.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index b9f709241c..61cd83b7b0 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -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', ),