-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgulpfile.js
34 lines (28 loc) · 845 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
30
31
32
33
34
'use strict';
var gulp = require('gulp');
var fs = require('fs-extra');
var path = require('path');
gulp.task('clean', function (done) {
fs.remove(path.join(__dirname, '/build'), done);
});
gulp.task('build', ['clean'], function () {
var webpack = require('webpack-stream');
return gulp.src('')
.pipe(webpack({
target: 'node',
context: path.join(__dirname, '/test/'),
entry: './test.js',
output: {
path: path.join(__dirname, '/build/'),
filename: 'test.js',
},
}))
.pipe(gulp.dest('build/'));
});
gulp.task('test', ['build'], function () {
var mocha = require('gulp-mocha');
require('should');
return gulp.src('build/*.js', {read: false})
.pipe(mocha());
});
gulp.task('default', ['test']);