-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
29 lines (25 loc) · 946 Bytes
/
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
var gulp = require('gulp'),
addsrc = require('gulp-add-src'),
less = require('gulp-less'),
jasmineBrowser = require('gulp-jasmine-browser');
function getNittroFiles(pkg, type) {
var prefix = pkg ? './node_modules/' + pkg + '/' : './';
return require(prefix + 'nittro.json').files[type || 'js'].map(function (file) {
return prefix + file;
});
}
var files = [
'node_modules/promiz/promiz.js'
]
.concat(getNittroFiles('nittro-core'))
.concat(getNittroFiles('nittro-ajax'))
.concat(getNittroFiles())
.concat('tests/mocks/**.js', 'tests/specs/**.spec.js');
gulp.task('test', function () {
return gulp.src(getNittroFiles(null, 'css'))
.pipe(less())
.pipe(addsrc.append(files, {base: process.cwd()}))
.pipe(jasmineBrowser.specRunner({console: true}))
.pipe(jasmineBrowser.headless({driver: 'phantomjs'}));
});
gulp.task('default', gulp.series('test'));