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

mocha-spec-cov-alt

v1.1.1

Published

Mocha/blanket spec coverage reporter and enforcer.

Downloads

81

Readme

mocha-spec-cov-alt

Gitter chat peerDependency Status Analytics


A Mocha reporter, which extends the spec runner to display and (optionally) enforce blanket Code Coverage metrics. Applying it to other runners, should be as simple as replacing the .super_ SpecCov property.

I wrote a blog post about it a while back.

screenshot

This was heavily inspired by Alex Seville's work on the travis-cov.

Install it with:

npm install mocha-spec-cov-alt

Simple usage

The easiest way to set this up, right now, is to run:

$ npm i -g mocha-spec-cov-alt
# ...
/usr/local/bin/mocha-spec-cov-alt -> /usr/local/lib/node_modules/mocha-spec-cov-alt/bin/index.js
[email protected] /usr/local/lib/node_modules/mocha-spec-cov-alt
$ mocha-spec-cov-alt
Adding mocha-spec-cov-alt to your package.json... OK
Adding `mocha`, `mocha-spec-cov-alt` and `blanket` through npm:
[email protected] node_modules/mocha
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])

[email protected] node_modules/blanket
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

This will automatically add all the required nodes to your package.json file, install the dependencies and quit. You can then run tests with npm test.

Usage

To use it, add the key "spec-cov" to the "config": { "blanket": {} } node in your package.json file. Currently supported options are:

  • threshold - A global threshold to enforce. (defaults to 80)
  • localThreshold - A local threshold to enforce.
  • lcovOutput - A path to a file to output lcov data to, for use with CodeClimate or CoverAlls. (by default, the file won't be generated)

You should then run mocha with:

mocha --require blanket -R mocha-spec-cov-alt

For more info on setting-up blanket, see: https://github.com/alex-seville/blanket

The annotated source is avaible at https://yamadapc.github.io/mocha-spec-cov-alt and was generated with docco.

License

Copyright (c) 2014 Pedro Tacla Yamada. Licensed under the MIT license. Please refer to the LICENSE file for more info.

Donations

Would you like to buy me a beer? Send bitcoin to 3JjxJydvoJjTrhLL86LGMc8cNB16pTAF3y