-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
60 lines (50 loc) · 1.57 KB
/
gulpfile.js
File metadata and controls
60 lines (50 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/****************
* Gaming Register Client
***************/
'use strict';
var gulp = require('gulp');
var protractor = require('gulp-protractor').protractor;
var karmaServer = require('karma').Server;
var eslint = require('gulp-eslint');
var exec = require('child_process').exec;
gulp.task('dev', function devTask() {
var watcher = gulp.watch(['gulpfile.js', './app/**/*.js', './tests/**/*.js']);
watcher.on('change', function fileChanged() {
gulp.src(['gulpfile.js', './app/**/*.js', './tests/**/*.js'])
.pipe(eslint())
.pipe(eslint.format());
});
});
gulp.task('lint', function lintTask() {
return gulp.src(['gulpfile.js', './app/**/*.js', './tests/**/*.js'])
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('e2e', function e2eTask() {
require('./tests/e2e/mock-api/server.js');
gulp.src(['./tests/e2e/spec/**/*.js'])
.pipe(protractor({
configFile: './tests/e2e/protractor.conf.js'
}));
});
gulp.task('unit', function unitTask(done) {
new karmaServer({ //eslint-disable-line new-cap
configFile: __dirname + '/tests/unit/karma.conf.js',
singleRun: true
}, done).start();
});
gulp.task('run', function runApp(cb) {
exec('.\\nw_support\\nw.exe .', function executeFunction(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('build', ['unit', 'e2e', 'lint'], function runAll() {});
gulp.task('default', function defaultTask() {
gulp.src(testFiles)
.pipe(karma({
configFile: './tests/unit/karma.conf.js',
action: 'watch'
}));
});