-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathgulpfile.js
46 lines (38 loc) · 1.03 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
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var mochaPhantomJS = require('./');
var paths = {
scripts: ['**/*.js', '!node_modules/**'],
tests: 'test/**.*js'
};
gulp.task('jshint', function () {
return gulp
.src(paths.scripts)
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test', ['jshint'], function () {
return gulp
.src(paths.tests)
.pipe(mocha({reporter: 'spec'}));
});
gulp.task('run:pass', function () {
return gulp
.src('test/fixture-pass.html')
.pipe(mochaPhantomJS({reporter: 'spec'}));
});
gulp.task('run:dump', function () {
return gulp
.src('test/fixture-pass.html')
.pipe(mochaPhantomJS({reporter: 'xunit', dump:'dump.xml'}));
});
gulp.task('run:http', function () {
var stream = mochaPhantomJS();
stream.write({path: 'http://localhost:8000/test/fixture-pass.html'});
stream.end();
return stream;
});
gulp.task('default', ['test']);