Skip to content

Commit

Permalink
Adding coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicola committed Sep 1, 2018
1 parent e1bf092 commit e237c0a
Show file tree
Hide file tree
Showing 6 changed files with 369 additions and 152 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Add any directories, files, or patterns you don't want to be tracked by version control
node_modules
dist
coverage
build
tmp
TODO
Expand Down
10 changes: 10 additions & 0 deletions config/webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ module.exports = {
},
module: {
rules: [
{
enforce: 'post',
test: /\.ts$/,
loader: 'istanbul-instrumenter-loader',
query: {
esModules: true
},
include: helpers.root('src', 'lib', 'src'),
exclude: /(node_modules|spec\.ts$|fake|class)/,
},
{
test: /\.ts$/,
loaders: [
Expand Down
9 changes: 7 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = function (config) {
exclude: [
],
preprocessors: {
'./config/karma-test-shim.js': ['webpack', 'sourcemap']
'./config/karma-test-shim.js': ['webpack', 'sourcemap'],
'./src/lib/src/**/*.ts': 'coverage'
},
webpack: webpackTest,
webpackMiddleware: {
Expand All @@ -19,7 +20,11 @@ module.exports = function (config) {
webpackServer: {
noInfo: true
},
reporters: ['progress', 'kjhtml'],
reporters: ['progress', 'kjhtml', 'coverage'],
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
client: { clearContext: false },
port: 9876,
colors: true,
Expand Down
Loading

0 comments on commit e237c0a

Please sign in to comment.