Use gulp-mocha

This commit is contained in:
Aya Morisawa 2017-03-01 18:13:01 +09:00
parent db715570d4
commit f21f5aa73a
2 changed files with 12 additions and 2 deletions

View file

@ -19,6 +19,7 @@ import * as rimraf from 'rimraf';
import * as chalk from 'chalk'; import * as chalk from 'chalk';
import imagemin = require('gulp-imagemin'); import imagemin = require('gulp-imagemin');
import * as rename from 'gulp-rename'; import * as rename from 'gulp-rename';
import * as mocha from 'gulp-mocha';
const env = process.env.NODE_ENV; const env = process.env.NODE_ENV;
const isProduction = env === 'production'; const isProduction = env === 'production';
@ -95,7 +96,7 @@ gulp.task('build:copy', () =>
) )
); );
gulp.task('test', ['lint', 'build']); gulp.task('test', ['lint', 'mocha']);
gulp.task('lint', () => gulp.task('lint', () =>
gulp.src('./src/**/*.ts') gulp.src('./src/**/*.ts')
@ -105,6 +106,13 @@ gulp.task('lint', () =>
.pipe(tslint.report()) .pipe(tslint.report())
); );
gulp.task('mocha', () =>
gulp.src([])
.pipe(mocha({
compilers: 'ts:ts-node/register'
} as any))
);
gulp.task('clean', cb => gulp.task('clean', cb =>
rimraf('./built', cb) rimraf('./built', cb)
); );

View file

@ -19,7 +19,7 @@
"clean": "gulp clean", "clean": "gulp clean",
"cleanall": "gulp cleanall", "cleanall": "gulp cleanall",
"lint": "gulp lint", "lint": "gulp lint",
"test": "mocha --compilers ts:ts-node/register --harmony" "test": "gulp test"
}, },
"dependencies": { "dependencies": {
"@types/bcryptjs": "2.4.0", "@types/bcryptjs": "2.4.0",
@ -38,6 +38,7 @@
"@types/gm": "1.17.29", "@types/gm": "1.17.29",
"@types/gulp": "3.8.32", "@types/gulp": "3.8.32",
"@types/gulp-babel": "6.1.29", "@types/gulp-babel": "6.1.29",
"@types/gulp-mocha": "0.0.29",
"@types/gulp-rename": "0.0.31", "@types/gulp-rename": "0.0.31",
"@types/gulp-tslint": "3.6.30", "@types/gulp-tslint": "3.6.30",
"@types/gulp-typescript": "0.0.32", "@types/gulp-typescript": "0.0.32",
@ -96,6 +97,7 @@
"gulp-babel": "6.1.2", "gulp-babel": "6.1.2",
"gulp-cssnano": "2.1.2", "gulp-cssnano": "2.1.2",
"gulp-imagemin": "3.1.1", "gulp-imagemin": "3.1.1",
"gulp-mocha": "4.0.1",
"gulp-pug": "3.2.0", "gulp-pug": "3.2.0",
"gulp-rename": "1.2.2", "gulp-rename": "1.2.2",
"gulp-tslint": "7.1.0", "gulp-tslint": "7.1.0",