Commit c2940c54d8fb03c867ecde69c720fd01bdc83a89

Authored by Eric Fernandez
1 parent 2549988554
Exists in master

concatenar archivos spec

Showing 3 changed files with 22 additions and 6 deletions   Show diff stats
... ... @@ -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,6 +52,17 @@ 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-chofer.spec.js'),
  59 + replace("src/views/", ''),
  60 + header("describe('Módulo foca-abm-chofer', 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());
... ... @@ -57,7 +71,7 @@ gulp.task('clean', function() {
57 71 gulp.task('pre-commit', function() {
58 72 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')
... ... @@ -69,7 +83,7 @@ gulp.task('pre-commit', function() {
69 83  
70 84 gulp.task('clean-post-install', function() {
71 85 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
72   - 'index.html'], {read: false})
  86 + 'index.html', 'spec'], {read: false})
73 87 .pipe(clean());
74 88 });
75 89  
... ... @@ -4,7 +4,7 @@
4 4 "description": "Abm de chofer",
5 5 "main": "index.html",
6 6 "scripts": {
7   - "test": "echo \"Error: no test specified\" && exit 1",
  7 + "test": "test.html",
8 8 "compile": "gulp uglify",
9 9 "gulp-pre-commit": "gulp pre-commit",
10 10 "postinstall": "npm run compile && gulp clean-post-install",
... ... @@ -36,7 +36,8 @@
36 36 },
37 37 "devDependencies": {
38 38 "angular": "^1.7.7",
39   - "angular-route": "^1.7.5",
  39 + "angular-mocks": "^1.7.7",
  40 + "angular-route": "^1.7.7",
40 41 "bootstrap": "^4.2.1",
41 42 "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git",
42 43 "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git",
... ... @@ -45,6 +46,7 @@
45 46 "gulp-angular-templatecache": "^2.2.6",
46 47 "gulp-clean": "^0.4.0",
47 48 "gulp-connect": "^5.7.0",
  49 + "gulp-header": "^2.0.7",
48 50 "gulp-htmlmin": "^5.0.1",
49 51 "gulp-jshint": "^2.1.0",
50 52 "gulp-rename": "^1.4.0",
1   -angular.module('focaAbmChofer', []);
  1 +angular.module('focaAbmChofer', ['ngRoute']);