}
return options;
- },
-
- /**
- * wiredep options for karma.conf.js
- */
- wiredepKarmaOptions: function(isVerbose) {
- var options = {
- // The directory of your Bower packages. default: '.bowerrc'.directory || bower_components
- bowerJson: bower.json,
- // Your bower.json file contents. default: require('./bower.json')
- directory: bower.directory,
- // string or regexp to ignore from the injected filepath
- ignorePath: bower.ignorePath,
- dependencies: true, // default: true
- devDependencies: true, // default: false
- };
-
- if (isVerbose) {
- options.onError = function (err) {
- console.log('wiredep error: ' + err.code);
- };
- options.onFileUpdated = function (filePath) {
- console.log('wiredep updated file: ' + filePath);
- };
- options.onPathInjected = function (fileObject) {
- console.log('wiredep injected file: ' + fileObject.block);
- console.log('wiredep injected file: ' + fileObject.file);
- console.log('wiredep injected file: ' + fileObject.path);
- };
- options.onMainNotFound = function (pkg) {
- console.log('wiredep name of bower package without main: ' + pkg);
- }
- }
-
- return options;
}
};
log('*** Wiring bower dependencies and injecting files into html ***');
var wiredep = require('wiredep').stream;
- var jsFiles = args.stubs ? [].concat(config.jsFilesWithoutSpecs, config.jsFilesStubs) : config.jsFilesWithoutSpecs;
+ var jsFiles = config.jsFilesWithoutSpecs;
+ var options = config.wiredepOptions(args.verbose ? true : false);
+
+ if (args.stubs) {
+ jsFiles = [].concat(config.jsFilesWithoutSpecs, config.jsFilesStubs);
+ options.devDependencies = true;
+ }
return gulp.src(config.index)
- .pipe(wiredep(config.wiredepOptions(args.verbose ? true : false)))
+ .pipe(wiredep(options))
.pipe(inject(jsFiles, ''))
.pipe(gulp.dest(config.main));
});
log('*** Wiring bower dependencies into karma.conf.js ***');
var wiredep = require('wiredep').stream;
+ var options = config.wiredepOptions(args.verbose ? true : false);
+ options.devDependencies = true;
return gulp.src(config.karmaConf)
- .pipe(wiredep(config.wiredepKarmaOptions(args.verbose ? true : false)))
+ .pipe(wiredep(options))
.pipe(gulp.dest(currentDir));
});
*
* @returns {Stream}
*/
- gulp.task('test', ['vet', 'wireupkarma'], function(done) {
+ gulp.task('test', ['vet', 'wireupkarma', 'templatecache'], function(done) {
log('*** Run tests once ***');
* @description
* Run specs and wait. Watch for file changes and re-run tests on each change
*/
- gulp.task('autotest', ['wireupkarma'], function(done) {
+ gulp.task('autotest', ['wireupkarma', 'templatecache'], function(done) {
log('*** Run tests and wait ***');