Skip to content

Commit

Permalink
fix: remove outDir when collecting coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed May 8, 2017
1 parent 96e799c commit c076956
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Prior to version `20.0.0`, coverage reports could be obtained using the inbuilt

To generate coverage results, set the `mapCoverage` property in the `jest` configuration section to `true`.

> Please note that the `outDir` property in the `jest` configuration section is removed in coverage mode, due to [#201](https://github.com/kulshekhar/ts-jest/issues/201).
### React Native

There is a few additional steps if you want to use it with React Native.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-jest",
"version": "20.0.0",
"version": "20.0.1",
"main": "index.js",
"types": "./dist/index.d.ts",
"description": "A preprocessor with sourcemap support to help use Typescript with Jest",
Expand Down
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export function getTSConfig(globals, collectCoverage: boolean = false) {

config.inlineSourceMap = true;
config.inlineSources = true;

if (config.outDir) {
// the coverage report is broken if `.outDir` is set
// see https://github.com/kulshekhar/ts-jest/issues/201
delete config.outDir;
}
}

if (config.allowSyntheticDefaultImports) {
Expand Down

0 comments on commit c076956

Please sign in to comment.