-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
57 lines (51 loc) · 1.76 KB
/
gulpfile.js
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
(function() {
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
karma = require('karma').server,
bowerDir = 'public/bower_components',
publicJSDir = 'public/javascripts/applications/',
librariesPath = [
bowerDir + '/angular/angular.js',
bowerDir + '/angular-route/angular-route.js',
bowerDir + '/md5-angular-filter/js/md5.filter.js'
],
testLibrariesPath = [
bowerDir + '/angular-mocks/angular-mocks.js'
],
sourcePath = [
publicJSDir + 'common/quizzoCommonApp.js',
publicJSDir + 'player/playerApp.js',
publicJSDir + 'moderator/moderatorApp.js',
publicJSDir + '**/services/**/*.js',
publicJSDir + '**/controllers/**/*.js',
publicJSDir + '**/filters/**/*.js'
],
testPath = [
'test/javascripts/**/*.js'
],
testSrc = gulp.src(librariesPath.concat(librariesPath, sourcePath, testLibrariesPath, testPath));
gulp.task('hint-sources', function() {
gulp.src(sourcePath)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('hint-test-sources', function() {
gulp.src(testPath)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('hint', ['hint-sources', 'hint-test-sources']);
gulp.task('test', function() {
return testSrc
.pipe(karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
throw err;
});
});
}());