Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-jsx-coverage

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-jsx-coverage

Enable coverage on .JSX or .coffee files.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-47.46%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-jsx-coverage

Enable coverage on .JSX or .coffee files.

npm version Dependency Status License

This is not a gulp plugin, it just a task creator to help you deal with istanbul instrumenter and collect coverage report in gulp

NOTE: coffee html/lcov report is buggy now

Install

npm install gulp-jsx-coverage

Usage

  • The golden rule: Use .jsx as ext name
gulp.task('your_task_name', require('gulp-jsx-coverage').createTask({
    src: ['test/**/*.js', 'test/components/*.jsx'],  // will pass to gulp.src
    istanbul: {                                      // will pass to istanbul
        coverageVariable: '__MY_TEST_COVERAGE__',
        exclude: /node_modules|\/test\//             // pattern to skip instrument
    },
    coverage: {
        reporters: ['text-summary', 'json', 'lcov'], // list of istanbul reporters
        directory: 'coverage'                        // will pass to istanbul reporters
    },
    mocha: {                                         // will pass to mocha
        reporter: 'spec'
    },
    react: {                                         // will pass to react-tools
        sourceMap: true
    },
    coffee: {                                        // will pass to coffee.compile
        sourceMap: true
    }
}));

Live Example

git clone https://github.com/zordius/gulp-jsx-coverage.git
cd gulp-jsx-coverage
npm install
npm test

Output:

> gulp-jsx-coverage@0.0.1 test /Users/zordius/gulp-jsx-coverage
> gulp

[17:21:00] Using gulpfile ~/gulp-jsx-coverage/gulpfile.js
[17:21:00] Starting 'default'...


  test coverage
    ✓ should covered 

  test coverage
    ✓ should covered 


  2 passing (32ms)

-------------------|-----------|-----------|-----------|-----------|
File               |   % Stmts |% Branches |   % Funcs |   % Lines |
-------------------|-----------|-----------|-----------|-----------|
   test/           |     90.91 |        50 |     91.67 |     90.91 |
      target.js    |     66.67 |       100 |        50 |     66.67 |
      test1.js     |       100 |       100 |       100 |       100 |
      test2.jsx    |     93.33 |        50 |       100 |     93.33 |
      test3.coffee |     88.89 |        50 |       100 |     88.89 |
-------------------|-----------|-----------|-----------|-----------|
All files          |     90.91 |        50 |     91.67 |     90.91 |
-------------------|-----------|-----------|-----------|-----------|

Keywords

FAQs

Package last updated on 31 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc