Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
grunt-qunit-blanket-lcov
Advanced tools
Readme
Save LCOV reports generated by Blanket for Grunt QUnit.
This is used to save Blanket.js tests coverage results done with grunt-contrib-qunit in order to send them to Coveralls.io with grunt-coveralls.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-qunit-blanket-lcov --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-qunit-blanket-lcov');
Simply follow Blanket.js guide to setup the test coverage with QUnit. No special configuration of the test suite is needed.
Your test HTML should look like :
<!DOCTYPE html>
<html>
<head>
<title>My test suite</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../bower_components/qunit/qunit/qunit.css">
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/qunit/qunit/qunit.js"></script>
<script src="../bower_components/blanket/dist/qunit/blanket.min.js"></script>
<script src="../src/library.js" data-cover></script>
<script src="core.js"></script>
</head>
<body>
<!-- -->
</body>
</html>
Don't forget to change the urls
of the qunit
task to add ?coverage=true
for each test suite.
In your project's Gruntfile, add a section named qunit_blanket_lcov
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
qunit_blanket_lcov: {
lib: {
src: 'src/library.js',
options: {
prefix: 'http://localhost:<%= connect.test.options.port %>/',
dest: '.coverage-results/library.lcov'
}
}
}
});
Then add or edit your test
Grunt task to execute qunit_blanket_lcov
before qunit
.
grunt.registerTask('test', [
'qunit_blanket_lcov',
'qunit'
]);
Type: string
Required
Output file for LCOV data.
Type: string
Required
The prefix to remove from file paths, this is generally the host + port of the grunt-contrib-connect
task you use.
Type: boolean
Default value: false
By default the task will fail if there is no coverage results to write.
Type: boolean
Default value: true
Automatically insert the custom Blanket reporter in the PhantomJS instance. If you redefined the inject
option of grunt-contrib-qunit
you must set this option to false
and manually add node_modules/grunt-qunit-blanket-lcov/reporter.js
to the inject list.
In this example the test coverage results of library.js
will be saved to library.lcov
.
grunt.initConfig({
qunit_blanket_lcov: {
lib: {
src: 'src/library.js',
options: {
prefix: 'http://localhost:9001/',
dest: '.coverage-results/library.lcov'
}
}
}
});
If you have many source files used by QUnit analyzed by Blanket it might be a good idea to use the Grunt files globbing option.
grunt.initConfig({
qunit_blanket_lcov: {
all: {
files: [{
expand: true,
src: ['src/*.js', 'src/plugins/**/plugin.js']
}],
options: {
prefix: 'http://localhost:9001/',
dest: '.coverage-results/all.lcov'
}
}
}
});
FAQs
Save LCOV reports generated by Blanket for Grunt QUnit.
The npm package grunt-qunit-blanket-lcov receives a total of 0 weekly downloads. As such, grunt-qunit-blanket-lcov popularity was classified as not popular.
We found that grunt-qunit-blanket-lcov 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.