2016-01-23 12:26:56 -05:00
|
|
|
/*
|
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
|
|
|
* http://paperjs.org/
|
|
|
|
*
|
2020-05-23 16:24:42 -04:00
|
|
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
|
|
* http://juerglehni.com/ & https://puckey.studio/
|
2016-01-23 12:26:56 -05:00
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
var gulp = require('gulp'),
|
2016-02-11 04:05:21 -05:00
|
|
|
gutil = require('gulp-util'),
|
2016-07-09 17:49:11 -04:00
|
|
|
qunits = require('gulp-qunits'),
|
2017-12-06 17:07:59 -05:00
|
|
|
runSequence = require('run-sequence');
|
2016-02-11 04:05:21 -05:00
|
|
|
webserver = require('gulp-webserver');
|
2016-01-27 13:57:07 -05:00
|
|
|
|
2017-12-06 17:07:59 -05:00
|
|
|
gulp.task('test', function(callback) {
|
|
|
|
runSequence(
|
2018-10-25 14:22:55 -04:00
|
|
|
'build',
|
|
|
|
'jshint'
|
2018-03-29 15:20:02 -04:00
|
|
|
// 'test:postbuild' // Disable tests for getting text stuff out
|
2017-12-06 17:07:59 -05:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('test:postbuild', ['test:phantom', 'test:node']);
|
2016-01-27 13:57:07 -05:00
|
|
|
|
2016-02-11 04:05:21 -05:00
|
|
|
gulp.task('test:phantom', ['minify:acorn'], function() {
|
2016-01-28 08:39:40 -05:00
|
|
|
return gulp.src('index.html', { cwd: 'test' })
|
|
|
|
.pipe(qunits({
|
2016-01-29 07:02:51 -05:00
|
|
|
checkGlobals: true,
|
2018-10-03 05:37:28 -04:00
|
|
|
timeout: 40
|
2016-01-28 08:39:40 -05:00
|
|
|
}));
|
2016-01-27 13:57:07 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('test:node', ['minify:acorn'], function(callback) {
|
2016-01-28 08:39:40 -05:00
|
|
|
return gulp.src('load.js', { cwd: 'test' })
|
|
|
|
.pipe(qunits({
|
|
|
|
require: [
|
|
|
|
// To dynamically load the tests files from the sources, we need
|
|
|
|
// to require Prepro.js first.
|
|
|
|
'prepro/lib/node.js',
|
|
|
|
// Note that loading dist/paper-full.js also works in
|
|
|
|
// combination with `gulp load`, in which case Prepro.js is
|
|
|
|
// present and handles the loading transparently.
|
|
|
|
{ path: '../dist/paper-full.js', namespace: 'paper' }
|
|
|
|
],
|
2016-01-29 20:56:05 -05:00
|
|
|
timeout: 40
|
2016-01-28 08:39:40 -05:00
|
|
|
}));
|
2016-01-23 12:26:56 -05:00
|
|
|
});
|
2016-02-11 04:05:21 -05:00
|
|
|
|
|
|
|
gulp.task('test:browser', ['minify:acorn'], function() {
|
|
|
|
gulp.src('.')
|
|
|
|
.pipe(webserver({
|
|
|
|
open: '/test'
|
|
|
|
}));
|
|
|
|
});
|