MCPcopy Index your code
hub / github.com/alex-seville/blanket

github.com/alex-seville/blanket @v1.1.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.7 ↗ · + Follow
411 symbols 782 edges 163 files 5 documented · 1% 3 cross-repo links updated 3y ago★ 1,396153 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Blanket.js

A seamless JavaScript code coverage library.

Project home page
Blanket_js on Twitter for updates and news.

NOTE: All Pull-Requests must be made into the development branch.

Build Status

NOTE: Blanket.js will throw XHR cross domain errors if run with the file:// protocol. See Special Features Guide for more details and workarounds.

Getting Started

Please see the following guides for using Blanket.js:

Browser * Getting Started (Basic QUnit usage) * Intermediate (Other test runners, global options) * Advanced (writing your own reporters/adapters) * Special Features Guide

Node * Getting Started (basic mocha setup) * Intermediate (mocha testrunner, travis-ci reporter) * Intermediate 2 (mocha, htmlcov, package.json setup)

Configuration * Options (Browser and Node)

Philosophy

Blanket.js is a code coverage tool for javascript that aims to be:

  1. Easy to install
  2. Easy to use
  3. Easy to understand

Blanket.js can be run seamlessly or can be customized for your needs.

Mechanism

JavaScript code coverage compliments your existing JavaScript tests by adding code coverage statistics (which lines of your source code are covered by your tests).

Blanket works in a 3 step process:

  1. Loading your source files
  2. Parsing the code using Esprima and node-falafel, and instrumenting the file by adding code tracking lines.
  3. Connecting to hooks in the test runner to output the coverage details after the tests have completed.

Grunt Integration

You've got a few options for using Grunt with Blanket:

grunt-blanket

A Grunt plugin has been created to allow you to use Blanket like a "traditional" code coverage tool (creating instrumented copies of physical files, as opposed to live-instrumenting). The plugin runs as a standlone project and can be found here.

grunt-blanket-qunit

Runs the QUnit-based Blanket report headlessly using PhantomJS. Results are displayed on the console, and the task will cause Grunt to fail if any of your configured coverage thresholds are not met. Minimum code coverage thresholds can be configured per-file, per-module, and globally.

See:

Compatibility and Features List

See the Compatiblity and Feature List including links to working examples.

Roll your own

  1. git clone git@github.com:alex-seville/blanket.git
  2. npm install
  3. Add your custom build details to the grunt.js file under concat
  4. grunt buildit

A minified and unminfied copy of the source can be created (see the min task).

Development

All development takes place on the development branch
Your pull request must pass all tests (run npm test to be sure) and respect all existing coverage thresholds

Contact

Feel free to add questions to the Issue tracker, or send them to @blanket_js.

Contributors

Thanks to the many people who have contributed to the project.

And thanks also to: RequireJS, Esprima, node-falafel, Mocha, Qunit.

Roadmap

v1.1.5 - Refactor reporter API.

Revision History

May 1-13 - 1.1.4
Loaded reverting for grunt-blanket, branch tracking reporter fixed, coverage on-the-go (displaying coverage results while a single page is being used).

Apr 28-13 - 1.1.3 YUI support added with custom adapter (and some wrapping code). CompoundJS support appears to be outside the scope of project.

... (see full revision history)

License

Copyright (c) 2012-2013 Alex Seville
Licensed under the MIT license.

Core symbols most depended-on inside this repo

Shape

Function 411

Languages

TypeScript100%

Modules by API surface

test/jquery-usage/js/ext/sinon-1.3.1.js57 symbols
test/backbone-koans/js/ext/sinon-1.3.1.js57 symbols
test/jquery-usage/js/ext/jquery.js54 symbols
test/backbone-koans/js/ext/jquery.js54 symbols
test/commonjs/commonjs_bundle.js14 symbols
test/usage/underscore.js9 symbols
test/branchTracking/branch_sample.js9 symbols
test/jquery-usage/js/ext/backbone.js8 symbols
test/backbone-koans/js/ext/backbone.js8 symbols
test/backbone-koans/es5-shim.js8 symbols
src/qunit/reporter.js8 symbols
test/usage/backbone.js7 symbols

For agents

$ claude mcp add blanket \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page