From 84ff69be515bacf8a5346da6ef596bb8672ec381 Mon Sep 17 00:00:00 2001 From: rjz Date: Sat, 10 Dec 2016 09:40:22 -0800 Subject: [PATCH] Uses ts-jest for preprocessing @kulshekhar's `ts-jest` plugin gives us sourcemap support. For the sake of debugging test output and coverage reports, let's use it! --- package.json | 3 ++- preprocessor.js | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 preprocessor.js diff --git a/package.json b/package.json index 556f7f7..c37bc4e 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "react-addons-test-utils": "^15.3.0", "sinon": "1.17.4", "source-map-loader": "0.1.5", + "ts-jest": "^17.0.3", "ts-loader": "^0.8.2", "tslint": "^3.14.0", "typescript": "2.0.3", @@ -48,7 +49,7 @@ "js" ], "transform": { - "^.+\\.(ts|tsx)$": "/preprocessor.js" + "\\.(ts|tsx)$": "/node_modules/ts-jest/preprocessor.js" }, "testRegex": "/__tests__/.*\\.(ts|tsx|js)$" } diff --git a/preprocessor.js b/preprocessor.js deleted file mode 100644 index 48db30d..0000000 --- a/preprocessor.js +++ /dev/null @@ -1,11 +0,0 @@ -var tsc = require('typescript'); -var tsConfig = require('./tsconfig.json'); - -module.exports = { - process: function (src, path) { - if (path.match(/\.tsx?$/)) { - return tsc.transpile(src, tsConfig.compilerOptions, path, []); - } - return src; - } -};