\href{https://github.com/users/mattlewis92/sponsorship}{\texttt{ }} \href{https://travis-ci.org/mattlewis92/karma-coverage-istanbul-reporter}{\texttt{ }} \href{https://codecov.io/gh/mattlewis92/karma-coverage-istanbul-reporter}{\texttt{ }} \href{http://badge.fury.io/js/karma-coverage-istanbul-reporter}{\texttt{ }} \href{http://badge.fury.io/js/karma-coverage-istanbul-reporter}{\texttt{ }} \href{https://twitter.com/mattlewis92_}{\texttt{ }}

\begin{quote}
A karma reporter that uses the latest istanbul 1.\+x APIs (with full sourcemap support) to report coverage. \end{quote}
\hypertarget{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15699}{}\doxysection{About}\label{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15699}
This is a reporter only and does not perform the actual instrumentation of your code. Babel users should use the \href{https://github.com/istanbuljs/babel-plugin-istanbul}{\texttt{ istanbul babel plugin}} to instrument your code and webpack + typescript users should use the \href{https://github.com/JS-DevTools/coverage-istanbul-loader}{\texttt{ coverage-\/istanbul-\/loader}} and then use this karma reporter to do the actual reporting. See the \href{https://github.com/mattlewis92/karma-coverage-istanbul-reporter/blob/master/test/karma.conf.js}{\texttt{ test config}} for an e2e example of how to combine them.\hypertarget{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15700}{}\doxysection{Installation}\label{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15700}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install karma-\/coverage-\/istanbul-\/reporter -\/-\/save-\/dev }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15701}{}\doxysection{Configuration}\label{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15701}

\begin{DoxyCode}{0}
\DoxyCodeLine{// karma.conf.js}
\DoxyCodeLine{const path = require('path');}
\DoxyCodeLine{}
\DoxyCodeLine{module.exports = function(config) \{}
\DoxyCodeLine{  config.set(\{}
\DoxyCodeLine{    // ... rest of karma config}
\DoxyCodeLine{}
\DoxyCodeLine{    // anything named karma-\/* is normally auto included so you probably dont need this}
\DoxyCodeLine{    plugins: ['karma-\/coverage-\/istanbul-\/reporter'],}
\DoxyCodeLine{}
\DoxyCodeLine{    reporters: ['coverage-\/istanbul'],}
\DoxyCodeLine{}
\DoxyCodeLine{    coverageIstanbulReporter: \{}
\DoxyCodeLine{      // reports can be any that are listed here: https://github.com/istanbuljs/istanbuljs/tree/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-\/reports/lib}
\DoxyCodeLine{      reports: ['html', 'lcovonly', 'text-\/summary'],}
\DoxyCodeLine{}
\DoxyCodeLine{      // base output directory. If you include \%browser\% in the path it will be replaced with the karma browser name}
\DoxyCodeLine{      dir: path.join(\_\_dirname, 'coverage'),}
\DoxyCodeLine{}
\DoxyCodeLine{      // Combines coverage information from multiple browsers into one report rather than outputting a report}
\DoxyCodeLine{      // for each browser.}
\DoxyCodeLine{      combineBrowserReports: true,}
\DoxyCodeLine{}
\DoxyCodeLine{      // if using webpack and pre-\/loaders, work around webpack breaking the source path}
\DoxyCodeLine{      fixWebpackSourcePaths: true,}
\DoxyCodeLine{}
\DoxyCodeLine{      // Omit files with no statements, no functions and no branches covered from the report}
\DoxyCodeLine{      skipFilesWithNoCoverage: true,}
\DoxyCodeLine{}
\DoxyCodeLine{      // Most reporters accept additional config options. You can pass these through the `report-\/config` option}
\DoxyCodeLine{      'report-\/config': \{}
\DoxyCodeLine{        // all options available at: https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-\/reports/lib/html/index.js\#L257-\/L261}
\DoxyCodeLine{        html: \{}
\DoxyCodeLine{          // outputs the report in ./coverage/html}
\DoxyCodeLine{          subdir: 'html'}
\DoxyCodeLine{        \}}
\DoxyCodeLine{      \},}
\DoxyCodeLine{}
\DoxyCodeLine{      // enforce percentage thresholds}
\DoxyCodeLine{      // anything under these percentages will cause karma to fail with an exit code of 1 if not running in watch mode}
\DoxyCodeLine{      thresholds: \{}
\DoxyCodeLine{        emitWarning: false, // set to `true` to not fail the test command when thresholds are not met}
\DoxyCodeLine{        // thresholds for all files}
\DoxyCodeLine{        global: \{}
\DoxyCodeLine{          statements: 100,}
\DoxyCodeLine{          lines: 100,}
\DoxyCodeLine{          branches: 100,}
\DoxyCodeLine{          functions: 100}
\DoxyCodeLine{        \},}
\DoxyCodeLine{        // thresholds per file}
\DoxyCodeLine{        each: \{}
\DoxyCodeLine{          statements: 100,}
\DoxyCodeLine{          lines: 100,}
\DoxyCodeLine{          branches: 100,}
\DoxyCodeLine{          functions: 100,}
\DoxyCodeLine{          overrides: \{}
\DoxyCodeLine{            'baz/component/**/*.js': \{}
\DoxyCodeLine{              statements: 98}
\DoxyCodeLine{            \}}
\DoxyCodeLine{          \}}
\DoxyCodeLine{        \}}
\DoxyCodeLine{      \},}
\DoxyCodeLine{}
\DoxyCodeLine{      verbose: true // output config used by istanbul for debugging}
\DoxyCodeLine{    \}}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15702}{}\doxysubsection{List of reporters and options}\label{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15702}

\begin{DoxyItemize}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/clover/index.js\#L14-L15}{\texttt{ clover}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/cobertura/index.js\#L16-L17}{\texttt{ cobertura}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/html-spa/index.js\#L47-L61}{\texttt{ html-\/spa}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/html/index.js\#L257-L261}{\texttt{ html}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/json-summary/index.js\#L12}{\texttt{ json-\/summary}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/json/index.js\#L12}{\texttt{ json}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/lcov/index.js\#L13}{\texttt{ lcov}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/lcovonly/index.js\#L11-L12}{\texttt{ lcovonly}}
\item none
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/teamcity/index.js\#L13-L14}{\texttt{ teamcity}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/text-lcov/index.js\#L11}{\texttt{ text-\/lcov}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/text-summary/index.js\#L13}{\texttt{ text-\/summary}}
\item \href{https://github.com/istanbuljs/istanbuljs/blob/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib/text/index.js\#L231-L237}{\texttt{ text}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15703}{}\doxysection{Credits}\label{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15703}

\begin{DoxyItemize}
\item \href{https://github.com/karma-runner/karma-coverage/blob/master/lib/reporter.js}{\texttt{ Original karma-\/coverage source}}
\item \href{https://github.com/facebook/jest/blob/master/scripts/mapCoverage.js}{\texttt{ Example of using the new reporter API}}
\item \href{https://github.com/marcules/karma-remap-istanbul}{\texttt{ Karma remap istanbul}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15704}{}\doxysection{License}\label{md_sfcode_node_modules_karma_coverage_istanbul_reporter_README_autotoc_md15704}
MIT 