-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (26 loc) · 978 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
35
36
var spawn = require('child_process').spawn;
var gulp = require('gulp');
var gutil = require('gulp-util');
var nunjucksRender = require('gulp-nunjucks-render');
gulp.task('test', ['nunjucks'], function () {
var tests = ['test/casper/tests/'];
var casperChild = spawn('casperjs', ['test'].concat(tests));
casperChild.stdout.on('data', function (data) {
gutil.log('CasperJS:', data.toString().slice(0, -1)); // Remove \n
});
casperChild.on('close', function (code) {
var success = code === 0; // Will be 1 in the event of failure
// Do something with success here
if (!success) {
process.exit(1);
}
});
});
gulp.task('nunjucks', function() {
// Gets .html and .nunjucks files in pages
return gulp.src('test/nunjucks/*.nunjucks')
.pipe(nunjucksRender({
path: ['test/nunjucks/partials/', 'test/nunjucks/layouts/']
}))
.pipe(gulp.dest('test/pages/'))
});