Skip to content

Commit

Permalink
Merge pull request #208 from kulshekhar/fix-collect-coverage
Browse files Browse the repository at this point in the history
Use 'instrument' as proxy for 'collectCoverage'

Fixes #207 
Also fixes #201 - again
  • Loading branch information
kulshekhar committed May 10, 2017
2 parents c81a59a + ad3460d commit 29b4b7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ts-jest",
"version": "20.0.2",
"version": "20.0.3",
"main": "index.js",
"types": "./dist/index.d.ts",
"description": "A preprocessor with sourcemap support to help use Typescript with Jest",
Expand Down
9 changes: 5 additions & 4 deletions src/preprocessor.ts
@@ -1,6 +1,6 @@
import * as fs from 'fs-extra';
import * as tsc from 'typescript';
import { getTSConfig, getJestConfig } from './utils';
import { getTSConfig } from './utils';
// TODO: rework next to ES6 style imports
const glob = require('glob-all');
const nodepath = require('path');
Expand All @@ -10,10 +10,11 @@ const babelJest = require('babel-jest')
plugins: ['transform-es2015-modules-commonjs']
});

export function process(src, path, config, transformOptions) {
export function process(src, path, config, transformOptions: any = {}) {
const root = require('pkg-dir').sync();
const jestConfig = getJestConfig(root);
const compilerOptions = getTSConfig(config.globals, jestConfig.collectCoverage);
// transformOptions.instrument is a proxy for collectCoverage
// https://github.com/kulshekhar/ts-jest/issues/201#issuecomment-300572902
const compilerOptions = getTSConfig(config.globals, transformOptions.instrument);

const isTsFile = path.endsWith('.ts') || path.endsWith('.tsx');
const isJsFile = path.endsWith('.js') || path.endsWith('.jsx');
Expand Down

0 comments on commit 29b4b7c

Please sign in to comment.