balena-cli/gulpfile.coffee

29 lines
730 B
CoffeeScript
Raw Normal View History

2014-10-31 13:48:53 +00:00
path = require('path')
2014-10-31 13:37:29 +00:00
gulp = require('gulp')
mocha = require('gulp-mocha')
2014-10-31 13:48:53 +00:00
coffeelint = require('gulp-coffeelint')
2014-10-31 13:37:29 +00:00
mochaNotifierReporter = require('mocha-notifier-reporter')
OPTIONS =
2014-10-31 13:50:50 +00:00
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
tests: 'lib/**/*.spec.coffee'
2014-10-31 13:37:29 +00:00
gulp.task 'test', ->
2014-10-31 13:50:50 +00:00
gulp.src(OPTIONS.files.tests, read: false)
.pipe(mocha({
reporter: mochaNotifierReporter.decorate('landing')
2014-10-31 13:50:50 +00:00
}))
2014-10-31 13:37:29 +00:00
2014-10-31 13:48:53 +00:00
gulp.task 'lint', ->
2014-10-31 13:50:50 +00:00
gulp.src(OPTIONS.files.coffee)
.pipe(coffeelint({
optFile: OPTIONS.config.coffeelint
}))
.pipe(coffeelint.reporter())
2014-10-31 13:48:53 +00:00
gulp.task 'watch', [ 'test', 'lint' ], ->
gulp.watch(OPTIONS.files.coffee, [ 'test', 'lint' ])