From 51b5e12de15cb59e625061196ab5134c75616e2c Mon Sep 17 00:00:00 2001 From: Matthew Ross Date: Thu, 21 Apr 2016 18:36:48 -0400 Subject: [PATCH] Initial API test setup --- gulpfile.js | 14 +++++++++----- package.json | 2 +- test/api/BoardsTest.php | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 test/api/BoardsTest.php diff --git a/gulpfile.js b/gulpfile.js index 8c846f3..48c69e9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,6 +10,7 @@ let gulp = require('gulp'), jsMinify = require('gulp-uglify'), mocha = require('gulp-mocha'), coverage = require('gulp-coverage'), + phpunit = require('gulp-phpunit'), scsslint = require('gulp-scss-lint'), sass = require('gulp-sass'), cssPrefixer = require('gulp-autoprefixer'), @@ -23,7 +24,8 @@ let gulp = require('gulp'), scss_base: 'node_modules/scss-base/src', tsconfig: 'src/app/tsconfig.json', ts: 'src/app/**/*.ts', - tests: 'test/app/**/*.spec.js', + tests_app: 'test/app/**/*.spec.js', + tests_api: 'test/api/**/*.php', html: [ 'src/**/*.html', 'src/.htaccess' @@ -121,12 +123,12 @@ gulp.task('api', () => { }); gulp.task('test-app', ['tsc', 'vendor'], () => { - return gulp.src(paths.tests) + return gulp.src(paths.tests_app) .pipe(mocha()); }); gulp.task('coverage', ['tsc', 'vendor'], () => { - return gulp.src(paths.tests) + return gulp.src(paths.tests_app) .pipe(coverage.instrument({ pattern: ['dist/app/**/*.js'] })) @@ -137,6 +139,8 @@ gulp.task('coverage', ['tsc', 'vendor'], () => { }); gulp.task('test-api', () => { + return gulp.src('') + .pipe(phpunit('./src/api/vendor/phpunit/phpunit/phpunit test/api/*Test.php')); }); gulp.task('watch', () => { @@ -158,8 +162,8 @@ gulp.task('watch', () => { }); gulp.task('watchtests', () => { - let watchTests =gulp.watch(paths.tests, ['test']), - watchTs = gulp.watch(paths.ts, ['test']), + let watchTests = gulp.watch(paths.tests_app, ['test-app']), + watchTs = gulp.watch(paths.ts, ['test-app']), onChanged = (event) => { console.log('File ' + event.path + ' was ' + event.type + '. Running tasks...'); diff --git a/package.json b/package.json index 9e785bc..2674f5f 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "gulp-cssnano": "^2.1.2", "gulp-imagemin": "^2.4.0", "gulp-mocha": "^2.2.0", + "gulp-phpunit": "^0.14.0", "gulp-sass": "^2.2.0", "gulp-scss-lint": "^0.3.9", "gulp-typescript": "^2.13.0", @@ -56,4 +57,3 @@ "zone.js": "^0.6.12" } } - diff --git a/test/api/BoardsTest.php b/test/api/BoardsTest.php new file mode 100644 index 0000000..5e477b5 --- /dev/null +++ b/test/api/BoardsTest.php @@ -0,0 +1,3 @@ +