Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Code coverage for Angular 2 and webpack 2 #835

@aaltotsky

Description

@aaltotsky

Does anyone have suggestions how to implement the code coverage for webpack2?

I tried https://github.com/aspnet/JavaScriptServices/wiki/Angular2SpaCodeCoverage, with some fixes:

var path = require('path');
var webpackConfig = require('../../webpack.config.js')().filter(config => config.target !== 'node')[0];
webpackConfig.module.loaders = [{
test: /.ts$/,
include: [path.resolve(__dirname, "../app/")],
loader: 'sourcemap-istanbul-instrumenter-loader?force-sourcemap=true',
exclude: [/.spec.ts$/],
enforce: 'post'
}];

but I was not able to produce the coverage report. The report is empty. Any suggestions or recommendations? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions