Gathering detailed insights and metrics for grunt-jasmine-node-coverage
Gathering detailed insights and metrics for grunt-jasmine-node-coverage
Gathering detailed insights and metrics for grunt-jasmine-node-coverage
Gathering detailed insights and metrics for grunt-jasmine-node-coverage
grunt-jasmine-node-coverage-validation
Grunt task for jasmine-node using istanbul for code coverage. Validates coverage configuration and fails the task for under coverage. Based off of grunt-jasmine-node-coverage by Jarrod Ribble.
grunt-jasmine-node-istanbul
Grunt multi-task for jasmine-node using istanbul for code coverage.
npm install grunt-jasmine-node-coverage
Typescript
Module System
Min. Node Version
Node Version
NPM Version
51.7
Supply Chain
91.8
Quality
72.2
Maintenance
100
Vulnerability
96.4
License
JavaScript (100%)
Total Downloads
423,816
Last Day
529
Last Week
3,099
Last Month
14,496
Last Year
106,372
MIT License
27 Stars
183 Commits
23 Forks
8 Watchers
1 Branches
24 Contributors
Updated on Aug 05, 2024
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
grunt-jasmine-node-coverage@2.0.1
Size
8.07 kB
NPM Version
5.4.2
Node Version
8.5.0
Published on
Sep 20, 2017
Cumulative downloads
Total Downloads
Last Day
-22.2%
529
Compared to previous day
Last Week
-4.8%
3,099
Compared to previous week
Last Month
62.8%
14,496
Compared to previous month
Last Year
56.7%
106,372
Compared to previous year
1
2
Runs jasmine with Istanbul code coverage
A Grunt task to run your Jasmine feature suite using jasmine-npm and Istanbul for code coverage reports.
The minimum supported Node.js version is 4.2.0
(LTS), and while works also in 0.10.x
, no quarantees are given.
Install this grunt plugin next to your project's Gruntfile.js
with:
1npm install grunt-jasmine-node-coverage --save-dev
Then add these lines to your project's Gruntfile.js
configuration file:
1grunt.initConfig({ 2 jasmine_node: { 3 task_name: { 4 options: { 5 forceExit: true, 6 coverage: { 7 includeAllSources: true 8 }, 9 jasmine: { 10 spec_dir: 'tests', 11 spec_files: [ 12 '**/*spec.js' 13 ] 14 } 15 }, 16 src: ['src/**/*.js'] 17 } 18 } 19}); 20 21grunt.loadNpmTasks('grunt-jasmine-node-coverage'); 22 23grunt.registerTask('default', 'jasmine_node');
Grunt tasks should be configured by following
the multi task configuration
form, thus wrapping each configuration in an object inside the jasmine_node
root object.
Type: object
Default: see below
Jasmine specific configuration. Use empty object,
{}
to use the defaults that are shown below.
1{ 2 spec_dir: 'spec', 3 spec_files: ['**/*[sS]pec/.js'], 4 helpers: [], 5 reporters: { 6 spec: {} 7 } 8}
See the jasmine docs for more information on the supported configuration.
The reporters
property allows the following properties:
spec
: used to configure the Jasmine spec reporter.teamcity
set it to true
in order to use Jasmine Reporters - TeamCityReporter.junitXml
set it to a object to use Jasmine Reporters - JUnitXmlReporter. See the jasmine-reporters
documentation for additional configuration options.If teamcity
reporter is set spec
reporter will be disabled and teamcity
reporter will be added to the coverage reporters as well.
Example of using teamcity
reporter:
1{ 2 spec_dir: 'spec', 3 spec_files: ['**/*[sS]pec/.js'], 4 helpers: [], 5 reporters: { 6 teamcity: true 7 } 8}
Example of using junitXml
reporter:
1{ 2 spec_dir: 'spec', 3 spec_files: ['**/*[sS]pec/.js'], 4 helpers: [], 5 reporters: { 6 junitXml: { 7 savePath: "reports", 8 consolidateAll: true 9 } 10 } 11}
Type: object
Default: see below
Istanbul specific configuration. Use empty object,
{}
to use the defaults that are shown below.
1{ 2 reportFile: 'coverage.json', 3 relativize: true, 4 thresholds: { 5 statements: 0, 6 branches: 0, 7 lines: 0, 8 functions: 0 9 }, 10 watermarks: { 11 statements: [50, 80], 12 lines: [50, 80], 13 functions: [50, 80], 14 branches: [50, 80], 15 }, 16 includeAllSources: false, 17 reportDir: 'coverage', 18 report: [ 19 'lcov', 20 'text-summary' 21 ], 22 collect: [ // false to disable, paths are relative to 'reportDir' 23 '*coverage.json' 24 ], 25 excludes: [] 26}
Notes:
excludes
list will automatically include '**/node_modules/**'
internally.thresholds
values greater than 0
will cause the task to fail if the specified threshold is not met.watermarks
config changes the thresholds at which the reports are displayed in red, yellow and green. It does not affect the outcome of the task.report
list will allow different types of istanbul report to be set.Type: string
Default: process.cwd()
See http://nodejs.org/api/process.html#process_process_cwd
Type: boolean
Default: false
Exit on failure by skipping any asynchronous tasks pending.
Type: boolean
Default: false
If set to true
, will log all uncaught exceptions.
Type: boolean
Default: false
When true
, istanbul will print more information when running.
Help us to squash them by submitting an issue that describes how you encountered it;
please be as specific as possible including operating system, node
, grunt
, and
grunt-jasmine-node-coverage
versions.
1npm --versions
The spec
reporter configuration has changed for v2 of this plugin. The following is an example of the change in configuration that is needed. This is not an exhaustive list: refer to the jasmine-spec-reporter for a full reference of the configuration options.
1// v1 2reporters: { 3 spec: { 4 colors: true, 5 displayStacktrace: 'summary', 6 displaySuccessfulSpec: true 7 } 8} 9 10// v2 11reporters: { 12 spec: { 13 colors: { 14 enabled: true 15 }, 16 summary: { 17 displayStacktrace: true 18 }, 19 spec: { 20 displaySuccessful: true 21 } 22 } 23}
If you are updating to v1.x
, you'll need to update your Gruntfile.
The following example outlines the changes needed. It assumes the following folder structure:
app/
├── src/
│ ├── abacus.js
│ └── calculator.js
└── test/
├── helpers.js
└── specs/
├── abacus.spec.js
└── calculator.spec.js
1// v0.5.0 config 2{ 3 jasmine_node: { 4 task_name: { 5 options: { 6 match: '.', 7 matchAll: true, 8 specFolders: ['test'], 9 extensions: 'js', 10 specNameMatcher: 'spec', 11 useHelpers: true 12 } 13 } 14 } 15} 16 17// v1.0.0 config 18{ 19 jasmine_node: { 20 task_name: { 21 options: { 22 jasmine: { 23 spec_dir: 'test', 24 spec_files: [ 25 'specs/*.spec.js' 26 ], 27 helpers: [ 28 'helpers.js' 29 ] 30 } 31 } 32 } 33 } 34}
Please note that the junit reporter is no longer available. If you are using this reporter and wish to update to v1, please open a new issue and we'll see if we can get it added back in. Even better, submit a PR :smile:
v2.0.1
(2017-09-20)
jasmine
of version 2.5.2
, which is not the latest (2.5.3
)v2.0.0
(2017-09-20)
v3.3.0
. Older style configuration needs to be updated, see migration guide for more details.v0.10
v1.2.0
(2017-04-30)
0.4
all the time, hence lowering the dependency requirement #60v1.1.1
(2016-08-29)
v0.4.5
and using data.src
instead of fileSrc
for compatibility #59v1.1.0
(2016-08-23)
v0.10.0
support back by using var
instead of const
and let
, #55v1.0.0
(2016-07-23)
4.2.0
(LTS), removed testing against 0.10
jasmine-node
to jasmine-npm
#35 #48includeAllSources
istanbul coverage option #45 #50v0.5.0
(2016-05-03)
lcov
outputv0.4.1
(2015-02-27)
v0.4.0
(2015-02-19)
v0.3.2
(2015-02-04)
v0.3.1
(2014-11-21)
v0.3.0
(2014-11-09)
v0.2.0
(2014-11-03)
v0.1.11
(2014-05-15)
grunt.renametask
use casev0.1.10
(2014-04-07)
v0.1.9
(2014-04-02)
jasmine_node.options.isVerbose
was not workingv0.1.8
(2014-03-03)
v0.1.7
(2013-12-13)
v0.1.6
(2013-07-26)
isVerbose
option to verbose
v0.1.5
(2013-07-15)
grunt-jasmine-node
Copyright (c) 2013 "jribble" Jarrod Ribble & contributors. Based on grunt-jasmine-node.
Copyright (c) 2012 "s9tpepper" Omar Gonzalez & contributors. Licensed under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
37 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More