Swiip / generator-gulp-angular

Yeoman generator for AngularJS with GulpJS [UNMAINTAINED next iteration is FountainJS]
http://fountainjs.io
3.72k stars 667 forks source link

gulp test:auto + jade #879

Open 0101adm opened 8 years ago

0101adm commented 8 years ago

jade templates are not re-processed on save while gulp test:auto is watching.

gulp test works fine.

{
  "generator-gulp-angular": {
    "version": "1.0.0",
    "props": {
      "angularVersion": "~1.4.2",
      "angularModules": [
        {
          "key": "animate",
          "module": "ngAnimate"
        },
        {
          "key": "cookies",
          "module": "ngCookies"
        },
        {
          "key": "touch",
          "module": "ngTouch"
        },
        {
          "key": "sanitize",
          "module": "ngSanitize"
        },
        {
          "key": "messages",
          "module": "ngMessages"
        },
        {
          "key": "aria",
          "module": "ngAria"
        }
      ],
      "jQuery": {
        "key": "jqLite"
      },
      "resource": {
        "key": "restangular",
        "module": "restangular"
      },
      "router": {
        "key": "ui-router",
        "module": "ui.router"
      },
      "ui": {
        "key": "angular-material",
        "module": "ngMaterial"
      },
      "cssPreprocessor": {
        "key": "node-sass",
        "extension": "scss"
      },
      "jsPreprocessor": {
        "key": "typescript",
        "extension": "ts",
        "srcExtension": "ts"
      },
      "htmlPreprocessor": {
        "key": "jade",
        "extension": "jade"
      },
      "bootstrapComponents": {
        "name": null,
        "version": null,
        "key": null,
        "module": null
      },
      "foundationComponents": {
        "name": null,
        "version": null,
        "key": null,
        "module": null
      },
      "paths": {
        "src": "src",
        "dist": "dist",
        "e2e": "e2e",
        "tmp": ".tmp"
      }
    }
  }
}
Swiip commented 8 years ago

strange, test:auto use the same watch task than serve. Don't you have gulp.watch(path.join(conf.paths.src, '/app/**/*.jade'), ['markups']); in your gulp/watch.js file?

0101adm commented 8 years ago

here is my watch.js

'use strict';

var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');
var browserSync = require('browser-sync');

function isOnlyChange(event) {
  return event.type === 'changed';
}

gulp.task('watch', ['scripts:watch', 'markups', 'inject'], function () {
  gulp.watch([path.join(conf.paths.src, '/*.html'), 'bower.json'], ['inject']);
  gulp.watch([
    path.join(conf.paths.src, '/app/**/*.css'),
    path.join(conf.paths.src, '/app/**/*.scss')
  ], function(event) {
    if(isOnlyChange(event)) {
      gulp.start('styles');
    } else {
      gulp.start('inject');
    }
  });
  gulp.watch(path.join(conf.paths.src, '/app/**/*.jade'), ['markups']);
  gulp.watch(path.join(conf.paths.src, '/app/**/*.html'), function(event) {
    browserSync.reload(event.path);
  });
});

just confirmed... when i re-save jade templates, tests do not re-run.

if i edit spec files, and save, the tests WILL re-run.