Skip to content

Commit f6cbe81

Browse files
committed
Preparing to new 🍇 and release. There is no promise of 🍺
1 parent 2457ca3 commit f6cbe81

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A [Grunt](http://gruntjs.com/) task to run your [Jasmine](http://jasmine.github.
1212
feature suite using [jasmine-npm](https://github.com/jasmine/jasmine-npm)
1313
and [Istanbul](https://github.com/gotwarlost/istanbul) for code coverage reports.
1414

15-
The minimum supported Node.js version is `4.2.0` (LTS).
15+
The minimum supported Node.js version is `4.2.0` (LTS), and while works also in `0.10.x`, no quarantees are given.
1616

1717
## Getting Started
1818

@@ -81,12 +81,14 @@ Jasmine specific configuration. Use empty object,
8181
See the [jasmine docs](http://jasmine.github.io/2.4/node.html#section-Configuration) for more information on the supported configuration.
8282

8383
The `reporters` property allows the one of the following properties:
84+
8485
* `spec`: used to configure the [Jasmine spec reporter](https://github.com/bcaudan/jasmine-spec-reporter).
8586
* `teamcity` set it to `true` in order to use [Jasmine Reporters - TeamCityReporter](https://github.com/larrymyers/jasmine-reporters).
8687

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

8990
Example of using `teamcity` reporter:
91+
9092
```js
9193
{
9294
spec_dir: 'spec',
@@ -138,10 +140,10 @@ Istanbul specific configuration. Use empty object,
138140

139141
Notes:
140142

141-
- The `excludes` list will automatically include `'**/node_modules/**'` internally.
142-
- Setting the `thresholds` values greater than `0` will cause the task to fail if the specified threshold is not met.
143-
- The `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.
144-
- Setting the `report` list will allow different types of istanbul report to be set.
143+
* The `excludes` list will automatically include `'**/node_modules/**'` internally.
144+
* Setting the `thresholds` values greater than `0` will cause the task to fail if the specified threshold is not met.
145+
* The `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.
146+
* Setting the `report` list will allow different types of istanbul report to be set.
145147

146148

147149
#### options.projectRoot
@@ -190,7 +192,7 @@ please be as specific as possible including operating system, `node`, `grunt`, a
190192
npm --versions
191193
```
192194

193-
## Migrating from pre v1 release
195+
## Migrating from before `v1.0.0` release
194196

195197
If you are updating to v1.0.0, you'll need to update your Gruntfile.
196198

@@ -249,6 +251,9 @@ Please note that the junit reporter is no longer available. If you are using thi
249251

250252
## Release History
251253

254+
* `v1.1.0` (2016-08-23)
255+
- Add Node.js `v0.10.0` support back by using `var` instead of `const` and `let`, #55
256+
- Teamcity reporter for Jasmine, #56
252257
* `v1.0.0` (2016-07-23)
253258
- **Breaking changes alert! Ensure you read the migration guide before updating from previous versions**
254259
- Minimum supported Node.js version is `4.2.0` (LTS), removed testing against `0.10`

package.json

Lines changed: 4 additions & 5 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.0.0",
4+
"version": "1.1.0",
55
"homepage": "https://github.com/jribble/grunt-jasmine-node-coverage",
66
"author": {
77
"name": "Jarrod Ribble",
@@ -11,7 +11,7 @@
1111
{
1212
"name": "Juga Paazmaya",
1313
"email": "paazmaya@yahoo.com",
14-
"url": "http://paazmaya.fi"
14+
"url": "https://paazmaya.fi"
1515
}
1616
],
1717
"repository": {
@@ -31,7 +31,6 @@
3131
"lint": "grunt eslint"
3232
},
3333
"files": [
34-
"bin",
3534
"tasks",
3635
"LICENSE-MIT",
3736
"package.json",
@@ -46,10 +45,10 @@
4645
},
4746
"devDependencies": {
4847
"grunt": "^1.0.1",
49-
"grunt-eslint": "^18.0.0"
48+
"grunt-eslint": "^19.0.0"
5049
},
5150
"peerDependencies": {
52-
"grunt": "^1.0.1"
51+
"grunt": "^1.0.0"
5352
},
5453
"keywords": [
5554
"gruntplugin",

tasks/jasmine-node-task.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ module.exports = function jasmineNodeTask(grunt) {
8888

8989
// Files that are not touched by code ran by the test runner is manually instrumented, to
9090
// illustrate the missing coverage.
91-
matchFn.files.forEach(function (file) {
91+
matchFn.files.forEach(function eachMatch(file) {
9292
if (!cov[file]) {
9393
transformer(fs.readFileSync(file, 'utf-8'), file);
9494

9595
// When instrumenting the code, istanbul will give each FunctionDeclaration a value of 1 in coverState.s,
9696
// presumably to compensate for function hoisting. We need to reset this, as the function was not hoisted,
9797
// as it was never loaded.
98-
Object.keys(instrumenter.coverState.s).forEach(function (key) {
98+
Object.keys(instrumenter.coverState.s).forEach(function eachKey(key) {
9999
instrumenter.coverState.s[key] = 0;
100100
});
101101

@@ -106,7 +106,8 @@ module.exports = function jasmineNodeTask(grunt) {
106106

107107
var collectReports = function collectReports(opts) {
108108
var reportFile = path.resolve(reportingDir, options.coverage.reportFile),
109-
collector = new istanbul.Collector(), // http://gotwarlost.github.io/istanbul/public/apidocs/classes/Collector.html
109+
// http://gotwarlost.github.io/istanbul/public/apidocs/classes/Collector.html
110+
collector = new istanbul.Collector(),
110111
cov = global[coverageVar];
111112

112113
if (options.coverage.includeAllSources) {
@@ -204,18 +205,18 @@ module.exports = function jasmineNodeTask(grunt) {
204205
var jasmine = new Jasmine();
205206
jasmine.loadConfig(options.jasmine);
206207
addReporters(jasmine);
207-
jasmine.onComplete(function(passed) {
208+
jasmine.onComplete(function jasmineComplete(passed) {
208209
options.onComplete(passed, opts);
209210
});
210211
jasmine.execute();
211212
}
212-
catch (e) {
213-
grunt.log.error('Jasmine runner failed: ' + e.stack);
213+
catch (error) {
214+
grunt.log.error('Jasmine runner failed: ' + error.stack);
214215
if (options.forceExit) {
215-
throw e;
216+
throw error;
216217
}
217218
else {
218-
done(e);
219+
done(error);
219220
}
220221
}
221222
};

0 commit comments

Comments
 (0)