
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
gulp-jsx-coverage
Advanced tools
Enable istanbul coverage on .JSX or .coffee files when you do mocha tests.
This is not a gulp plugin, it just a task creator to help you deal with istanbul instrumenter and collect coverage report in gulp
npm install gulp-jsx-coverage mocha --save-dev
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'
},
babel: { // will pass to babel
sourceMap: 'inline' // get hints in HTML covarage reports
},
coffee: { // will pass to coffee.compile
sourceMap: true // true to get hints in HTML coverage reports
},
//optional
cleanup: function () {
// do extra tasks after test done
// EX: clean global.window when test with jsdom
}
}));
git clone https://github.com/zordius/gulp-jsx-coverage.git
cd gulp-jsx-coverage
npm install
npm test
Output:
[14:10:58] Using gulpfile ~/gulp-jsx-coverage/gulpfile.js
[14:10:58] Starting 'default'...
test1.js coverage
✓ should covered
test2.jsx
✓ should covered
- should not covered
test3.coffee test
✓ should pass
- should not cover
3 passing (31ms)
2 pending
-------------------|-----------|-----------|-----------|-----------|
File | % Stmts |% Branches | % Funcs | % Lines |
-------------------|-----------|-----------|-----------|-----------|
test/ | 85.71 | 50 | 78.57 | 85.71 |
target.js | 66.67 | 100 | 50 | 66.67 |
test1.js | 100 | 100 | 100 | 100 |
test2.jsx | 92.86 | 100 | 83.33 | 92.86 |
test3.coffee | 75 | 50 | 75 | 75 |
-------------------|-----------|-----------|-----------|-----------|
All files | 85.71 | 50 | 78.57 | 85.71 |
-------------------|-----------|-----------|-----------|-----------|
[14:10:59] Finished 'default' after 671 ms
FAQs
Enable istanbul coverage on ES2015/babel or coffee-script/cjsx files when you do mocha/jasmine tests, also deal with sourceMap for coverage report and stack trace.
The npm package gulp-jsx-coverage receives a total of 66 weekly downloads. As such, gulp-jsx-coverage popularity was classified as not popular.
We found that gulp-jsx-coverage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.