paradigm-facebook-ia
Version:
Paradigm Facebook Instant Articles
67 lines (53 loc) • 1.37 kB
JavaScript
var execSync = require('child_process').execSync,
eslint = require('gulp-eslint'),
gulp = require('gulp'),
mocha = require('gulp-mocha'),
path = require('path'),
spawn = require('child_process').spawn
gulp.task('lint', function () {
return gulp.src([
'src/**/*.js',
'test/**/*.js'
])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError())
})
gulp.task('test-integration', function(done) {
gulp
.src([
'./test/setup.js',
'./test/integration/**.js',
], {read: false})
.pipe(mocha({reporter: 'spec'}))
.on('end', function () {
process.exit()
})
.on('error', function (e) {
console.error(e)
process.exit(1)
})
})
gulp.task('test-api', function(done) {
gulp
.src([
'./test/setup.js',
'./test/api/**.js',
], {read: false})
.pipe(mocha({reporter: 'spec'}))
.on('end', function () {
process.exit()
})
.on('error', function (e) {
console.error(e)
process.exit(1)
})
})
gulp.task('stop-reqlite', function(done) {
try {
execSync('forever stop test/reqlite.js --port-offset 1 -s')
} catch(e) {}
process.exit()
})
gulp.task('test', ['test-integration'])
gulp.task('t', ['test'])