From 8d60351376a8550faeea8d7359f72cc7d35fe12d Mon Sep 17 00:00:00 2001 From: efernandez Date: Tue, 26 Feb 2019 12:01:41 -0300 Subject: [PATCH] uglify specs --- gulpfile.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3f88bcf..4d88ed8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,6 +9,8 @@ const pump = require('pump'); const jshint = require('gulp-jshint'); const replace = require('gulp-replace'); const connect = require('gulp-connect'); +const header = require('gulp-header'); +const footer = require('gulp-footer'); var paths = { srcJS: 'src/js/*.js', @@ -32,7 +34,7 @@ gulp.task('templates', ['clean'], function() { ); }); -gulp.task('uglify', ['templates'], function() { +gulp.task('uglify', ['templates', 'uglify-spec'], function() { return pump( [ gulp.src([ @@ -50,6 +52,17 @@ gulp.task('uglify', ['templates'], function() { ); }); +gulp.task('uglify-spec', function() { + return pump([ + gulp.src(paths.specs), + concat('foca-crear-cobranza.spec.js'), + replace("src/views/", ''), + header("describe('Módulo foca-crear-cobranza', function() { \n"), + footer("});"), + gulp.dest(paths.dist) + ]); +}); + gulp.task('clean', function() { return gulp.src(['tmp', 'dist'], {read: false}) .pipe(clean()); @@ -76,7 +89,7 @@ gulp.task('webserver', function() { gulp.task('clean-post-install', function() { return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', - 'index.html'], {read: false}) + 'index.html', 'test.html', 'spec'], {read: false}) .pipe(clean()); }); -- 1.9.1