diff --git a/README.md b/README.md index c089f91b36..2ed4c4d474 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index c4e5c31503..da13484532 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/utils.ts b/src/utils.ts index 7d5a6e2175..58dda7935d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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) {