Skip to content

Commit 34d49b1

Browse files
committed
fix(init): set default filename
Since d4a06f2, the config file is set only if it exists, but `karma init` requires the filename to be set. This sets the filename to `karma.conf.js` if not present. Closes #680 Closes #681
1 parent 06532b7 commit 34d49b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ exports.init = function(config) {
351351

352352
sm.process(questions, function(answers) {
353353
var cwd = process.cwd();
354-
var configFile = config.configFile;
354+
var configFile = config.configFile || 'karma.conf.js';
355355
var templateFile = isCoffeeFile(configFile) ? COFFEE_TPL_PATH : JS_TPL_PATH;
356356
var replacements = getReplacementsFromAnswers(answers, getBasePath(configFile, process.cwd()));
357357
var content = fs.readFileSync(templateFile).toString().replace(/%(.*)%/g, function(a, key) {

0 commit comments

Comments
 (0)