-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for resource and action metadata in rendered HAL output
- Loading branch information
Showing
14 changed files
with
207 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ node_modules/ | |
*npm-debug.log | ||
data | ||
tmp | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
demo/ | ||
tmp/ | ||
node_modules/ | ||
node_modules/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,64 @@ | ||
var gulp = require( 'gulp' ), | ||
mocha = require( 'gulp-mocha' ); | ||
var istanbul = require( 'gulp-istanbul' ); | ||
var gulp = require( 'gulp' ); | ||
var mocha = require( 'gulp-mocha' ); | ||
var open = require( 'open' ); //jshint ignore : line | ||
|
||
function cover( done ) { | ||
gulp.src( [ './src/**/*.js' ] ) | ||
.pipe( istanbul() ) | ||
.pipe( istanbul.hookRequire() ) | ||
.on( 'finish', function() { | ||
done( runSpecs() ); | ||
} ); | ||
} | ||
|
||
function runSpecs() { // jshint ignore : line | ||
return gulp.src( [ './spec/*.spec.js' ], { read: false } ) | ||
.pipe( mocha( { reporter: 'spec' } ) ); | ||
} | ||
|
||
function writeReport( cb, openBrowser, tests ) { | ||
tests | ||
.on( 'error', function() { | ||
cb(); | ||
} ) | ||
.pipe( istanbul.writeReports() ) | ||
.on( 'end', function() { | ||
if( openBrowser ) { | ||
open( './coverage/lcov-report/index.html' ); | ||
} | ||
cb(); | ||
} ); | ||
} | ||
|
||
gulp.task( 'continuous-coverage', function( cb ) { | ||
cover( writeReport.bind( undefined, cb, false ) ); | ||
} ); | ||
|
||
gulp.task( 'continuous-test', function() { | ||
return runSpecs(); | ||
} ); | ||
|
||
gulp.task( 'coverage', function( cb ) { | ||
cover( writeReport.bind( undefined, cb, true ) ); | ||
} ); | ||
|
||
gulp.task( 'coverage-watch', function() { | ||
gulp.watch( [ './src/**/*', './spec/*.spec.js' ], [ 'continuous-coverage' ] ); | ||
} ); | ||
|
||
gulp.task( 'test', function() { | ||
return gulp.src( [ './spec/**.spec.js' ], { read: false } ) | ||
.pipe( mocha( { reporter: 'spec' } ) ) | ||
return runSpecs() | ||
.on( 'end', process.exit.bind( process, 0 ) ) | ||
.on( 'error', process.exit.bind( process, 1 ) ); | ||
} ); | ||
|
||
gulp.task( 'continuous-test', function() { | ||
return gulp.src( [ './spec/**.spec.js' ], { read: false } ) | ||
.pipe( mocha( { reporter: 'spec' } ) ); | ||
gulp.task( 'test-watch', function() { | ||
gulp.watch( [ './src/**/*', './spec/*.spec.js' ], [ 'continuous-test' ] ); | ||
} ); | ||
|
||
gulp.task( 'watch', function() { | ||
gulp.watch( [ './src/**', './spec/**' ], [ 'continuous-test' ] ); | ||
gulp.task( 'default', [ 'continuous-coverage', 'coverage-watch' ], function() { | ||
} ); | ||
|
||
gulp.task( 'default', [ 'continuous-test', 'watch' ], function() { | ||
gulp.task( 'specs', [ 'continuous-test', 'test-watch' ], function() { | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.