Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
jscoverage-reporter
Advanced tools
A Jasmine reporter that will capture code coverage metrics generated by JSCoverage. Works well with jasmine-node and PhantomJS.
At this point the reporter requires a little setup to use as it assumes you are already using jasmine-node for testing. A simple wrapper script described below makes it easy to add this reporter to an out of the box jasmine-node install.
npm install jscoverage-reporter
You will also need a version of JSCoverage installed to generate the covered files. My preference is to download and install from http://siliconforks.com/jscoverage/ as we also test non node.js code.
require('jscoverage-reporter');
jasmine.getEnv().addReporter(new jasmine.JSCoverageReporter('./reports'));
Create a file called coverage.js:
require('jasmine-node');
require('jscoverage-reporter');
var jasmineEnv = jasmine.getEnv();
// Adjust output directory as needed
jasmineEnv.addReporter(new jasmine.JSCoverageReporter('./reports'));
require('./node_modules/jasmine-node/lib/jasmine-node/cli.js');
After running JSCoverage on the code to test:
npm install jasmine-node
node coverage.js <jasmine-node options>
To run a single command that executes JSCoverage and runs the tests, an example can be found at tools/coverage.js.
In package.json
you can then define your test script as:
"test": "node tools/coverage --junitreport build/test",
Two files jscoverage.json
and coverage.xml
will be produced. The jscoverage.json
file can be used with the modified JSCoverage template to view the coverage. As JSCoverage complains about file based paths, to view the data a simple node.js based HTTP report server can be found in tools/report.js. The coverage.xml
is suitable for Emma report tracking such as with Emma Jenkins Plugin.
Copyright (c) 2012 Daniel Rinehart. This software is licensed under the MIT License.
FAQs
JSCoverage reporter for Jasmine
The npm package jscoverage-reporter receives a total of 0 weekly downloads. As such, jscoverage-reporter popularity was classified as not popular.
We found that jscoverage-reporter 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.