Skip to content

Commit

Permalink
fix: updates templates
Browse files Browse the repository at this point in the history
  • Loading branch information
huafu committed Aug 10, 2018
1 parent 31847b0 commit f2e1da2
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 31 deletions.
6 changes: 6 additions & 0 deletions e2e/__templates__/with-babel-6/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/__templates__/with-babel-6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"devDependencies": {
"babel-core": "^6.26.3",
"closest-file-data": "^0.1.4",
"jest": "^23.4.2",
"typescript": "^2.9.2"
}
Expand Down
122 changes: 97 additions & 25 deletions e2e/__templates__/with-babel-7/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions e2e/__templates__/with-babel-7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"private": true,
"devDependencies": {
"@babel/core": "^7.0.0-beta.56",
"babel-core": "^7.0.0-bridge.0",
"closest-file-data": "^0.1.4",
"jest": "^23.4.2",
"typescript": "^2.9.2"
}
Expand Down
7 changes: 1 addition & 6 deletions src/ts-jest-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,10 @@ export default class TsJestTransformer implements jest.Transformer {
return;
}

// default config
const baseConfig: BabelConfig = {
presets: ['jest'],
};

let babelConfig!: BabelConfig;
if (config.babelJest === true) {
// lookup babelrc file
babelConfig = babelCfg.extend(baseConfig, babelCfg.loadDefault(rootDir));
babelConfig = babelCfg.extend({}, babelCfg.loadDefault(rootDir));
} else if (typeof config.babelJest === 'string') {
// path to a babelrc file
let filePath = config.babelJest.replace('<rootDir>', `${rootDir}${sep}`);
Expand Down

0 comments on commit f2e1da2

Please sign in to comment.