-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
106 lines (83 loc) · 2.68 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// includes gulp
var gulp = require('gulp');
var stylish = require('jshint-stylish');
var nodemon = require('gulp-nodemon');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var cssmin = require('gulp-cssmin');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('sass', function () {
return gulp.src('./assets/scss/app.scss')
.pipe(sourcemaps.init())
.pipe(sass({style: "compressed"}).on('error', sass.logError))
.pipe(cssmin())
.pipe(rename({
suffix: '.min',
basename: 'bootstrap'
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./client/stylesheets'))
});
gulp.task('mocha', function () {
return gulp.src(['test/**/**/*.js'], {read: true})
.pipe(mocha({
reporter: 'spec', // console output format
ignoreLeaks: false, // Leaks
bail: false, // bail on first test fail
timeout: 10000 // timeout for test cases
}))
.on('error', gutil.log);
});
gulp.task('sourceTest', function () {
return gulp.src(['test/**/sourceTest/residentTest.js'], {read: true})
.pipe(mocha({
reporter: 'spec',
ignoreLeaks: false,
bail: false,
timeout: 7000
}));
});
gulp.task('testMappers', function () {
return gulp.src(['test/**/sourceTest/analyticsTest.js'], {read: true})
.pipe(mocha({
reporter: 'spec',
ignoreLeaks: false,
bail: false,
timeout: 700
}));
});
gulp.task('lint', function () {
return gulp.src('test/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
/**
* Build Project task
* compile sass, compress js - moves to client folder
* */
/**
* SASS compile task
* */
gulp.task('compile-sass',function () {
gulp.watch(['./public/scss/**'],['sass'])
});
/**
* OLD tasks
* */
gulp.task('data', function () {
return gulp.src('server/model/connection.js')
});
gulp.task('watch', function () {
gulp.watch(['server/source/*.js', 'test/**/*.js', 'server/model/*.js'], ['mocha', 'lint']);
});
gulp.task('watch-account', function () {
gulp.watch(['test/backendTest/sourceTest/*.js', 'server/source/accountMapper.js', 'server/source/residentMapper.js'], ['sourceTest']);
});
gulp.task('test', ['sourceTest']);
gulp.task('test-analytics', function () {
gulp.watch(['server/source/*.js', 'test/**/sourceTest/analyticsTest.js'], ['testMappers']);
});
gulp.task('default', ['watch', 'mocha', 'data', 'lint']);