Skip to content

Commit

Permalink
Merge pull request #26 from mmoulton/develop
Browse files Browse the repository at this point in the history
Release v0.2.0
  • Loading branch information
mmoulton committed Jan 22, 2014
2 parents 577b145 + ca07e52 commit 2739873
Show file tree
Hide file tree
Showing 8 changed files with 561 additions and 179 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@
### 0.1.1 (Dec 6, 2013)

* Will now create any missing directories when writing output to a file (resolved #19)

### 0.2.0 (Jan 22, 2014)

* Switched to official `node-coveralls` module for interfacing with coveralls.io.
Special thanks to @spenceralger for the pull request. (resolved #25)
* Updating all dependencies to latest versions and shrinkwrapping using `npm shrinkwrap`
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ lib/coveralls.js:

lib/mocha.js, tasks/mocha-coveralls.js:
based on original works by Roland Warmerdam Copyright (c) 2013

Spencer Alger <spencer@spenceralger.com>
56 changes: 44 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ The list of test files to run can be specified using either the standard Grunt f
* `compilers` (array) - use the given module(s) to compile files.

#### Coverage Options ####
* `coverage` (boolean) - instrument the source using blanket. This will automaticaly be enabled if you configure `coveralls`.
* `instrument` (boolean) - instrument the source using blanket. Defaults to true when you setup `coveralls`, or use specify a `*-cov` reporter, otherwise false.

#### Coveralls Options ####
* `coveralls` (Object) - indicate you wish to instrament your test and send coverage reports to coveralls.io
* `serviceName` (string) - name of the CI service for coveralls to integrate with (ie: travis-pro).
* `serviceJobId` (string) - The job id used by coveralls (default: process.env.TRAVIS_JOB_ID).
* `repoToken` (string) - repository identifier as provided by coveralls.
* `coveralls` (Boolean|Object) - Indicate you wish to send a coverage report to coveralls.io. ***Generally*** you can get away with seting this to `true` and letting [node-coveralls](https://github.com/cainus/node-coveralls) pick the necessary values out of the environment.
* `serviceName` (string) - name of the CI service for coveralls to integrate with (options are `travis-ci`, `jenkins`, `circleci`, or `codeship`).
* `serviceJobId` (string) - The job id used by coveralls (default based on service).
* `repoToken` (string) - repository identifier as provided by coveralls (defaults to the `COVERALLS_REPO_TOKEN` environment variable).

#### Extras ####
* `quiet` (boolean) - disable printing of Mocha's output to the terminal.
Expand Down Expand Up @@ -78,7 +78,7 @@ grunt.registerTask('test', ['mochacov']);

#### Built in HTML Coverage Report ####

If you use one of the built in built in coverage reports your code will automaticaly be instrumented by blanket:
If you use one of the built in coverage reports your code will automaticaly be instrumented by blanket:

```javascript
grunt.initConfig({
Expand All @@ -97,7 +97,7 @@ grunt.registerTask('test', ['mochacov']);
For this to work properly you will also need to inform [Blanket][] about what needs to be instrumented. The best way to do so is adding a block to your `package.json` such as:

```json
"scripts": {
"config": {
"blanket": {
"pattern": [
"src"
Expand All @@ -107,19 +107,16 @@ For this to work properly you will also need to inform [Blanket][] about what ne
```
This would instrument any .js files found under `src`.


#### Coveralls.io Integration with Travis CI ####

It's easy to send coverage data to coveralls.io from Travis CI. Simply provided the `coveralls` option with relavent params and that's it:
It's easy to send coverage data to coveralls.io from the most popular CI serivces (like Travis CI). Simply set the `coveralls` option to true:

```javascript
grunt.initConfig({
mochacov: {
coverage: {
options: {
coveralls: {
serviceName: 'travis-ci'
}
coveralls: true
}
},
test: {
Expand All @@ -137,6 +134,41 @@ grunt.registerTask('travis', ['mochacov:coverage']);
grunt.registerTask('test', ['mochacov:test']);
```

#### Keep your Coveralls repo token out of the environment ####

Don't want to keep your repo token in the environment where anyone could access it? Pass it in via the `coveralls.repoToken` option:

```js
grunt.initConfig({
mochacov: {
options: {
coveralls: {
repoToken: 'YOURREPOTOKEN'
}
},
coverage: ['test/*.js']
}
})
```

#### Setup intrumentation yourself ####

If you want to start blanket yourself, as in [this example](https://github.com/alex-seville/blanket/blob/master/docs/intermediate_node.md), just set the `instrument` option to false.

```javascript
grunt.initConfig({
mochacov: {
options: {
coveralls: true,
instrument: false
},
all: ['test/*.js']
}
});

grunt.registerTask('json_coverage', ['mochacov']);
```

License
-------
Grunt Mocha Coveralls is based on original works by Gregg Caines and Roland Warmerdam.
Expand Down
102 changes: 0 additions & 102 deletions lib/coveralls.js

This file was deleted.

Loading

0 comments on commit 2739873

Please sign in to comment.