redoc/build/tasks/e2e.js
2016-01-17 00:46:23 +02:00

35 lines
778 B
JavaScript

var gulp = require('gulp');
var gp = require('gulp-protractor');
var browserSync = require('browser-sync').create('bs-e2e');
gulp.task('test-server', function (done) {
browserSync.init({
open: false,
notify: false,
port: 3000,
ghostMode: false,
server: {
baseDir: './tests/e2e',
routes: {
'/dist': './dist',
'/swagger.json': './demo/swagger.json'
},
}
}, done);
});
gulp.task('e2e', ['bundleProd', 'test-server'], function(done) {
gulp.src(['tests/e2e/**/*.js'], { read:false })
.pipe(gp.protractor({
configFile: './protractor.conf.js'
})).on('error', function(e) {
browserSync.exit();
throw e;
done();
}).on('end', function() {
browserSync.exit();
done();
});
});