diff --git a/lib/commands/test-init.ts b/lib/commands/test-init.ts index e1e0adc9d2..10099c9461 100644 --- a/lib/commands/test-init.ts +++ b/lib/commands/test-init.ts @@ -101,12 +101,11 @@ class TestInitCommand implements ICommand { this.$fs.ensureDirectoryExists(testsDir); + const frameworks = [frameworkToInstall].concat(this.karmaConfigAdditionalFrameworks[frameworkToInstall] || []) + .map(fw => `'${fw}'`) + .join(', '); const karmaConfTemplate = this.$resources.readText('test/karma.conf.js'); - const karmaConf = _.template(karmaConfTemplate)({ - frameworks: [frameworkToInstall].concat(this.karmaConfigAdditionalFrameworks[frameworkToInstall]) - .map(fw => `'${fw}'`) - .join(', ') - }); + const karmaConf = _.template(karmaConfTemplate)({ frameworks }); this.$fs.writeFile(path.join(projectDir, 'karma.conf.js'), karmaConf);