Skip to content

Commit

Permalink
update normalize to handle ts
Browse files Browse the repository at this point in the history
  • Loading branch information
eightypop committed Dec 31, 2018
1 parent 4f6d522 commit 3e349f5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/jest-config/src/normalize.js
Expand Up @@ -164,12 +164,21 @@ const setupBabelJest = (options: InitialOptions) => {

if (customTSPattern) {
const customTSTransformer = transform[customTSPattern];
if (Array.isArray(customTSTransformer)) {
if (customTSTransformer[0] === 'babel-jest') {
babelJest = require.resolve('babel-jest');

if (customTSTransformer === 'babel-jest') {
babelJest = require.resolve('babel-jest');
transform[customTSPattern] = babelJest;
} else if (customTSTransformer.includes('babel-jest')) {
babelJest = customTSTransformer;
customTSTransformer[0] = babelJest;
} else if (customTSTransformer[0].includes('babel-jest')) {
babelJest = customTSTransformer[0];
}
} else {
if (customTSTransformer === 'babel-jest') {
babelJest = require.resolve('babel-jest');
transform[customTSPattern] = babelJest;
} else if (customTSTransformer.includes('babel-jest')) {
babelJest = customTSTransformer;
}
}
}
} else {
Expand Down

0 comments on commit 3e349f5

Please sign in to comment.