Skip to content

Commit c97eace

Browse files
authored
Merge branch 'master' into master
2 parents 6c32144 + 0782ac2 commit c97eace

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

Gruntfile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ module.exports = function (grunt) {
4141
spec: {
4242
colors: true
4343
},
44+
junitXml: {
45+
savePath: "reports",
46+
consolidateAll: true
47+
}
4448
// Uncomment line below to activate teamcity reporter
4549
//teamcity: true
4650
}

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ Jasmine specific configuration. Use empty object,
8080

8181
See the [jasmine docs](http://jasmine.github.io/2.4/node.html#section-Configuration) for more information on the supported configuration.
8282

83-
The `reporters` property allows the one of the following properties:
83+
The `reporters` property allows the following properties:
8484

8585
* `spec`: used to configure the [Jasmine spec reporter](https://github.com/bcaudan/jasmine-spec-reporter).
8686
* `teamcity` set it to `true` in order to use [Jasmine Reporters - TeamCityReporter](https://github.com/larrymyers/jasmine-reporters).
87+
* `junitXml` set it to a object to use [Jasmine Reporters - JUnitXmlReporter](https://github.com/larrymyers/jasmine-reporters). See the jasmine-reporters
88+
documentation for additional configuration options.
8789

8890
If `teamcity` reporter is set `spec` reporter will be disabled and `teamcity` reporter will be added to the coverage reporters as well.
8991

@@ -100,6 +102,21 @@ Example of using `teamcity` reporter:
100102
}
101103
```
102104

105+
Example of using `junitXml` reporter:
106+
107+
```js
108+
{
109+
spec_dir: 'spec',
110+
spec_files: ['**/*[sS]pec/.js'],
111+
helpers: [],
112+
reporters: {
113+
junitXml: {
114+
savePath: "reports",
115+
consolidateAll: true
116+
}
117+
}
118+
```
119+
103120
#### options.coverage
104121
105122
Type: `object`
@@ -283,10 +300,13 @@ app/
283300
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:
284301
285302
## Release History
303+
286304
* `unreleased`
287-
- **Breaking changes alert! Ensure you read the migration guide before updating from previous versions**
288-
- Updated to jasmine-spec-reporter v3.1.0. Older style configuration needs to be updated, see migration guide for more details.
289-
- Removed support for Node.js v0.10
305+
- **Breaking changes alert! Ensure you read the migration guide before updating from previous versions**
306+
- Updated to jasmine-spec-reporter v3.1.0. Older style configuration needs to be updated, see migration guide for more details.
307+
- Removed support for Node.js v0.10
308+
* `v1.2.0` (2017-04-30)
309+
- Was compatible with Grunt `0.4` all the time, hence lowering the dependency requirement #60
290310
* `v1.1.1` (2016-08-29)
291311
- Istanbul `v0.4.5` and using `data.src` instead of `fileSrc` for compatibility #59
292312
* `v1.1.0` (2016-08-23)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-jasmine-node-coverage",
33
"description": "Grunt task for running jasmine using istanbul for code coverage reports. Based off of grunt-jasmine-node by Omar Gonzalez (s9tpepper).",
4-
"version": "1.1.1",
4+
"version": "1.2.0",
55
"homepage": "https://github.com/jribble/grunt-jasmine-node-coverage",
66
"author": {
77
"name": "Jarrod Ribble",
@@ -37,7 +37,7 @@
3737
"README.md"
3838
],
3939
"dependencies": {
40-
"deepmerge": "^1.3.1",
40+
"deepmerge": "^1.3.2",
4141
"istanbul": "^0.4.5",
4242
"jasmine": "^2.5.2",
4343
"jasmine-reporters": "^2.2.0",

tasks/jasmine-node-task.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,16 @@ module.exports = function jasmineNodeTask(grunt) {
182182
reporter.name = 'TeamCity Reporter';
183183
jasmine.addReporter(reporter);
184184
}
185-
else {
185+
else if (ropts.spec) {
186186
reporter = new SpecReporter(ropts.spec);
187187
reporter.name = 'Spec Reporter';
188188
jasmine.addReporter(reporter);
189189
}
190+
191+
if (ropts.junitXml){
192+
reporter = new reporters.JUnitXmlReporter(ropts.junitXml);
193+
jasmine.addReporter(reporter);
194+
}
190195
};
191196

192197
var runner = function runner(opts) {
@@ -279,7 +284,6 @@ module.exports = function jasmineNodeTask(grunt) {
279284
jasmine: {
280285
spec_dir: 'spec',
281286
reporters: {
282-
spec: {}
283287
}
284288
},
285289

0 commit comments

Comments
 (0)