Comment Driven Development
This plugin requires Gulp ~3.9.9
If you haven't used Gulp before, be sure to check out the Getting Started guide, as it explains how to create a Gulp file as well as install and use Gulp plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install gulp-speckjs --save-dev
Once the plugin has been installed, it may be enabled inside your gulpfile with this line of JavaScript:
var speck = require('gulp-speckjs');
gulp.task('speck:tape', function() {
return gulp.src('./test/fixtures/*.js')
.pipe(foreach(function(stream, file) {
return stream
.pipe(speck({
testFW: 'tape',
logs: true,
relPath: '../specs/' + path.basename(file.path)
}))
.pipe(rename({
suffix : '_tapeSpec'
}));
}))
.pipe(gulp.dest('./test/fixtures/specs'));
});
testFW
: the test suite for which SpeckJS will buildrelPath
: the relative path that will be used inside each spec filelogs
: output on console success/error messages
In the above example the gulp-speckjs
plugin is used alongside gulp-foreach
and gulp-rename
for a complete control over the build pipeline. See gulp-speckjs's gulpfile.js for more examples.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.