![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
fru-grunt-qunit-istanbul
Advanced tools
Run QUnit unit tests in a headless PhantomJS instance and create coverage reports with istanbul.
Run QUnit unit tests in a headless PhantomJS instance with code coverage analysis provided by istanbul.
This is a fork of the grunt-contrib-qunit repo, adding the ability to generate istanbul test coverage reports. Unfortunately this cannot be handled as a seperate plugin, because it needs to hook into the grunt-contrib-qunit and grunt-lib-phantomjs structure.
This plugin should work as a drop-in replacement for your current qunit
task. For any further configuration, please check out the
original plugin's repo.
This plugin requires Grunt ~0.4.0
.
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 how to install and use Grunt plugins. Once you're familiar with that process, you can install this plugin with this command:
npm install grunt-qunit-istanbul --save-dev
Once the plugin has been installed, it can be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-qunit-istanbul');
Run this task with the grunt qunit
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
When installed by npm, this plugin will automatically download and install PhantomJS locally via the grunt-lib-phantomjs-istanbul library.
Also note that running grunt with the --debug
flag will output a lot of
PhantomJS-specific debugging information. This can be very helpful in seeing
what actual URIs are being requested and received by PhantomJS.
This plugin uses PhantomJS to run tests. PhantomJS requires the following dependencies:
On Ubuntu/Debian
apt-get install libfontconfig1 fontconfig libfontconfig1-dev libfreetype6-dev
On CentOS
yum install fontconfig freetype
array
[]
The js files you would like to end up in the coverage report.
string
A temporary folder (that will be automatically generated and deleted after the test suite finishes) containing the instrumented source code.
string
[optional]A folder where the HTML reports should be stored.
string
[optional]A folder where the Cobertura reports should be stored.
string
[optional]A folder where the LCOV reports should be stored.
string
[optional]A folder where the Clover reports should be stored.
string
[optional].
If you're running your qunit tests with the help of a webserver, you have to point the coverage inspector to the physical path that is the base url of the qunit page you're running.
number
[optional]Lines coverage percentage threshold to evaluate when running the build. If the actual coverage percentage is less than this value, the build will fail.
number
[optional]Statements coverage percentage threshold to evaluate when running the build. If the actual coverage percentage is less than this value, the build will fail.
number
[optional]Functions coverage percentage threshold to evaluate when running the build. If the actual coverage percentage is less than this value, the build will fail.
number
[optional]Branches coverage percentage threshold to evaluate when running the build. If the actual coverage percentage is less than this value, the build will fail.
boolean
[optional]false
Whether or not to dispose the previous collector and create a new instance of
it, discarding the info of previously instrumented files. This is useful if
using grunt-qunit-istanbul
as a
multi task with
separate targets generating separate coverage reports. If set to true
for a
particular target, the plugin will generate a coverage report only for the
files specified in the coverage.src
property, even when files used by the
current target were also instrumented by a previous target. See the related
bug report.
qunit: {
options: {
'--web-security': 'no',
coverage: {
disposeCollector: true,
src: ['src/js/**/*.js'],
instrumentedFiles: 'temp/',
htmlReport: 'report/coverage',
coberturaReport: 'report/',
linesThresholdPct: 85
}
},
all: ['test/**/*.html']
}
Original Task by "Cowboy" Ben Alman
Modified by asciidisco
FAQs
Run QUnit unit tests in a headless PhantomJS instance and create coverage reports with istanbul.
The npm package fru-grunt-qunit-istanbul receives a total of 0 weekly downloads. As such, fru-grunt-qunit-istanbul popularity was classified as not popular.
We found that fru-grunt-qunit-istanbul 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.