npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

coverageify

v1.0.4

Published

Browserify's transform for unit test coverage, using istanbul

Downloads

39

Readme

Coverageify

Browserify transform for unit test code coverage, using Istanbul.

Overview

Using coverageify will allow you to know how percentage of code you are covering with your unit tests. Coverageify is user with Karma & Karma Coverage. With the right configuration of your karma.conf.js file you'll be able to get a full report of your code coverage.

Installation

With npm do:

npm install --save-dev coverageify

Usage

Here is a raw example of how to use Coverageify with Karma and how to avoid trash data on your reports


module.exports = function(config) {
    config.set({
        
        files: [...],

        frameworks: ['browserify', ... ],

        browserify: {
            transform: [ ... , ['coverageify', {ignores: new RegExp(__dirname)}], ... ]
        },

        browsers : [...],

        reporters: [ ..., 'coverage'],

        preprocessors: {
            '...': ['browserify']
        },

        coverageReporter : {...},

    });
};

First of all you'll need to set the ignores attribute on the configuration object of coverageify to only get the right coverage, if not you'll get some trash values.

Then you'll need to use the coverage reporter for Karma provided by Karma Coverage.

Finally use browserify to preprocess your files.

Al the configuration that do not appears here is because is not really needed, the full configuration example is provided by Karma and Karma Coverage.

Configuration

The configuration object handled by Coverageify could contain the following attributes:

  • ignores: An array of file name patters that should be ignored by the reporter when the process is ongoing. We recomend to ignore all your mock, tests, and other files that should not be covered.

  • contains: An array of file name patters that must be contained on the file name when the process is ongoing. This is used in case you desire to filter the coverage.

As example here is a config file:

var config = {
    ignores: new RegExp(__dirname)
};
  • **To ignore files (that should not be covered) required by covered files you should add a comment with the following content ignored by test coverage

Recommendations

  • As seen is not needed to put 'coverage' to the preprocessors array list, if that is done we have noticed some issues with trash data.

Known issues

  • After trying some use cases, I've founded that for Windows you should ignore all the files with the __dirname on it, using the ignores option providing the next value new RegExp(__dirname) and for Linux you should only use the files that contains __dirname so you should use the contains option with the same value. Any other suggestions or problem with it let me know.

Credits

This project was inspired by istanbulify, developed by Fran�ois de Campredon