Skip to content

Commit

Permalink
fix: coverage (#42)
Browse files Browse the repository at this point in the history
* fix coverage report for karma
* fix coverage report for node
* combine coverage report from karam and node
  • Loading branch information
Viatorus authored Nov 22, 2017
1 parent 3a93477 commit 3509429
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 195 deletions.
6 changes: 5 additions & 1 deletion .nycrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"extension": [
".js"
".ts"
],
"reporter": [
"lcov",
"text-summary",
"html",
"json"
],
"exclude": [
"**/*.spec.ts",
"**/*.helper.ts"
],
"report-dir": "./coverage/node/"
}
50 changes: 27 additions & 23 deletions config/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,51 @@ module.exports = function (config) {
coverageIstanbulReporter: {
dir: "./coverage/karma/",
reports: ["text-summary", "lcov", "html", "json"],
fixWebpackSourcePaths: false
fixWebpackSourcePaths: true
},
mime: {
'text/x-typescript': ['ts']
"text/x-typescript": ["ts"]
},
webpack: {
externals: {
"fs": "fs"
},
resolve: {
extensions: ['.ts', '.js'],
extensions: [".ts"],
},
devtool: "inline-source-map",
devtool: "source-map",
module: {
// rules: [
// {
// test: /\.js$/,
// use: [
// {
// loader: "istanbul-instrumenter-loader",
// options: {
// esModules: true
// }
// },
// ]
// }
// ],
loaders: [
{
enforce: "pre",
test: /\.ts$/,
loader: "ts-loader"
loader: "tslint-loader",
exclude: /node_modules/,
options: {
failOnHint: true,
configFile: path.join("config", "tslint.json"),
}
},
{
test: /\.ts$/,
loader: "ts-loader",
options: {
configFile: path.join("config", "tsconfig.webpack.json")
}
},
{
enforce: "post",
exclude: [
/node_modules/,
/\.(spec|helper)\.ts$/
],
loader: "istanbul-instrumenter-loader?esModules=true",
test: /\.ts$/
}
]
}
},

plugins: [
"karma-chrome-launcher",
"karma-coverage",
"karma-coverage-istanbul-reporter",
"istanbul-instrumenter-loader",
"karma-jasmine",
"karma-jasmine-matchers",
"karma-webpack",
Expand Down
6 changes: 3 additions & 3 deletions config/webpack-config-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ module.exports = (options) => {
},
externals: options.externals,
resolve: {
extensions: [".ts", ".js"]
extensions: [".ts"]
},
devtool: "source-map",
module: {
loaders: [
{
enforce: 'pre',
enforce: "pre",
test: /\.ts$/,
loader: 'tslint-loader',
loader: "tslint-loader",
exclude: /node_modules/,
options: {
failOnHint: true,
Expand Down
Loading

0 comments on commit 3509429

Please sign in to comment.