Commit 20099fa8e91b1302d07f88e4d08bb614ee0be7e9
1 parent
5bdceaaa21
Exists in
master
and in
2 other branches
prueba commit
Showing
3 changed files
with
25 additions
and
10 deletions
Show diff stats
gulpfile.js
| ... | ... | @@ -9,10 +9,13 @@ const jshint = require('gulp-jshint'); |
| 9 | 9 | const replace = require('gulp-replace'); |
| 10 | 10 | const connect = require('gulp-connect'); |
| 11 | 11 | const clean = require('gulp-clean'); |
| 12 | +const header = require('gulp-header'); | |
| 13 | +const footer = require('gulp-footer'); | |
| 12 | 14 | |
| 13 | 15 | var paths = { |
| 14 | 16 | srcJS: 'src/js/*.js', |
| 15 | 17 | srcViews: 'src/views/*.html', |
| 18 | + specs: 'spec/*.js', | |
| 16 | 19 | tmp: 'tmp', |
| 17 | 20 | dist: 'dist/' |
| 18 | 21 | }; |
| ... | ... | @@ -32,7 +35,7 @@ gulp.task('templates', function() { |
| 32 | 35 | ); |
| 33 | 36 | }); |
| 34 | 37 | |
| 35 | -gulp.task('uglify', ['templates'], function() { | |
| 38 | +gulp.task('uglify', ['templates', 'uglify-spec'], function() { | |
| 36 | 39 | return pump( |
| 37 | 40 | [ |
| 38 | 41 | gulp.src([ |
| ... | ... | @@ -49,27 +52,36 @@ gulp.task('uglify', ['templates'], function() { |
| 49 | 52 | ); |
| 50 | 53 | }); |
| 51 | 54 | |
| 55 | +gulp.task('uglify-spec', function() { | |
| 56 | + return pump([ | |
| 57 | + gulp.src(paths.specs), | |
| 58 | + concat('foca-abm-vendedor-cobrador.spec.js'), | |
| 59 | + replace("src/views/", ''), | |
| 60 | + header("describe('Módulo foca-abm-vendedor-cobrador', function() { \n"), | |
| 61 | + footer("});"), | |
| 62 | + gulp.dest(paths.dist) | |
| 63 | + ]); | |
| 64 | +}); | |
| 65 | + | |
| 52 | 66 | gulp.task('clean', function() { |
| 53 | 67 | return gulp.src(['tmp', 'dist'], {read: false}) |
| 54 | 68 | .pipe(clean()); |
| 55 | 69 | }); |
| 56 | 70 | |
| 57 | 71 | gulp.task('pre-commit', function() { |
| 58 | - pump( | |
| 72 | + return pump( | |
| 59 | 73 | [ |
| 60 | - gulp.src(paths.srcJS), | |
| 74 | + gulp.src([paths.srcJS, paths.specs]), | |
| 61 | 75 | jshint('.jshintrc'), |
| 62 | 76 | jshint.reporter('default'), |
| 63 | 77 | jshint.reporter('fail') |
| 64 | 78 | ] |
| 65 | 79 | ); |
| 66 | - | |
| 67 | - gulp.start('uglify'); | |
| 68 | 80 | }); |
| 69 | 81 | |
| 70 | 82 | gulp.task('clean-post-install', function() { |
| 71 | 83 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
| 72 | - 'index.html'], {read: false}) | |
| 84 | + 'index.html', 'spec', 'test.html'], {read: false}) | |
| 73 | 85 | .pipe(clean()); |
| 74 | 86 | }); |
| 75 | 87 |
package.json
spec/routeSpec.js
| ... | ... | @@ -12,16 +12,16 @@ describe('Rutas de abm vendedor cobrador', function() { |
| 12 | 12 | it('ruta /vendedor-cobrador lleva a ruta correcta', function() { |
| 13 | 13 | //assert |
| 14 | 14 | expect(route.routes['/vendedor-cobrador'].controller) |
| 15 | - .toBe('focaAbmVendedoresCobradoresController') | |
| 15 | + .toBe('focaAbmVendedoresCobradoresController'); | |
| 16 | 16 | expect(route.routes['/vendedor-cobrador'].templateUrl) |
| 17 | - .toBe('src/views/foca-abm-vendedor-cobrador-listado.html') | |
| 17 | + .toBe('src/views/foca-abm-vendedor-cobrador-listado.html'); | |
| 18 | 18 | }); |
| 19 | 19 | |
| 20 | 20 | it('ruta /vendedor-cobrador/:id lleva a ruta correcta', function() { |
| 21 | 21 | //assert |
| 22 | 22 | expect(route.routes['/vendedor-cobrador/:id'].controller) |
| 23 | - .toBe('focaAbmVendedorCobradorController') | |
| 23 | + .toBe('focaAbmVendedorCobradorController'); | |
| 24 | 24 | expect(route.routes['/vendedor-cobrador/:id'].templateUrl) |
| 25 | - .toBe('src/views/foca-abm-vendedor-cobrador-item.html') | |
| 25 | + .toBe('src/views/foca-abm-vendedor-cobrador-item.html'); | |
| 26 | 26 | }); |
| 27 | 27 | }); |