Skip to content

Commit d17fd94

Browse files
fix(unit-testing): Fix tests executed with jasmine
Trying to execute execute tests with jasmine fails, as during initialization we have written incorrect data in karma.config.js file. The error is: `Error: No provider for “framework:undefined”! (Resolving: framework:undefined)` The problem is that during initalization we set undefined for framework value. Fix the initalization code to enter correct data in karma.config.js
1 parent a2d491e commit d17fd94

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/commands/test-init.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,11 @@ class TestInitCommand implements ICommand {
101101

102102
this.$fs.ensureDirectoryExists(testsDir);
103103

104+
const frameworks = [frameworkToInstall].concat(this.karmaConfigAdditionalFrameworks[frameworkToInstall] || [])
105+
.map(fw => `'${fw}'`)
106+
.join(', ');
104107
const karmaConfTemplate = this.$resources.readText('test/karma.conf.js');
105-
const karmaConf = _.template(karmaConfTemplate)({
106-
frameworks: [frameworkToInstall].concat(this.karmaConfigAdditionalFrameworks[frameworkToInstall])
107-
.map(fw => `'${fw}'`)
108-
.join(', ')
109-
});
108+
const karmaConf = _.template(karmaConfTemplate)({ frameworks });
110109

111110
this.$fs.writeFile(path.join(projectDir, 'karma.conf.js'), karmaConf);
112111

0 commit comments

Comments
 (0)