diff --git a/app/index.js b/app/index.js index 3fac9b8..d1526ba 100644 --- a/app/index.js +++ b/app/index.js @@ -52,19 +52,34 @@ var Generator = module.exports = function Generator(args, options) { args: args }); - this.hookFor('karma', { - as: 'app', - options: { + this.on('end', function () { + this.installDependencies({ skipInstall: this.options['skip-install'] }); + + var enabledComponents = []; + + if (this.resourceModule) { + enabledComponents.push('angular-resource/angular-resource.js'); + } + + if (this.cookiesModule) { + enabledComponents.push('angular-cookies/angular-cookies.js'); + } + + if (this.sanitizeModule) { + enabledComponents.push('angular-sanitize/angular-sanitize.js'); + } + + this.invoke('karma:app', { options: { coffee: this.options.coffee, travis: true, - 'skip-install': this.options['skip-install'] - } - } - }); - - this.on('end', function () { - this.installDependencies({ skipInstall: this.options['skip-install'] }); + 'skip-install': this.options['skip-install'], + components: [ + 'angular/angular.js', + 'angular-mocks/angular-mocks.js' + ].concat(enabledComponents) + } + }); }); this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json'))); diff --git a/package.json b/package.json index a0b2348..5f0484a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "yeoman-generator": "~0.13.0" }, "peerDependencies": { - "generator-karma": "~0.5.0", + "generator-karma": "~0.6.0", "yo": ">=1.0.0-rc.1.1" }, "devDependencies": {