Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
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[0-9]/ // do not instrument these files
},
transpile: { // this is default whitelist/blacklist for transpilers
babel: {
include: /\.jsx?$/,
exclude: /node_modules/
},
coffee: {
include: /\.coffee$/
}
},
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:
[15:22:34] Using gulpfile ~/gulp-jsx-coverage/gulpfile.js
[15:22:34] Starting 'default'...
target (tested by test1.js)
✓ should multiply correctly
- should not show coverage info for test1.js
target (tested by test2.jsx)
✓ should multiply correctly (50ms)
- should not show coverage info for test2.jsx
target (tested by test3.coffee)
✓ should multiply correctly
- should not show coverage info for test3.coffee
3 passing (58ms)
3 pending
----------------|-----------|-----------|-----------|-----------|
File | % Stmts |% Branches | % Funcs | % Lines |
----------------|-----------|-----------|-----------|-----------|
test/ | 66.67 | 100 | 50 | 66.67 |
target.js | 66.67 | 100 | 50 | 66.67 |
----------------|-----------|-----------|-----------|-----------|
All files | 66.67 | 100 | 50 | 66.67 |
----------------|-----------|-----------|-----------|-----------|
[15:22:35] Finished 'default' after 753 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 23 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.