File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,17 @@ exports.init = function(config) {
255
255
sm . process ( questions , function ( answers ) {
256
256
var cwd = process . cwd ( ) ;
257
257
var configFile = config . configFile || 'karma.conf.js' ;
258
- var testMainFile = ( / \. c o f f e e $ / ) . test ( configFile ) ? 'test-main.coffee' : 'test-main.js' ;
258
+ var isCoffee = path . extname ( configFile ) === '.coffee' ;
259
+ var testMainFile = isCoffee ? 'test-main.coffee' : 'test-main.js' ;
259
260
var formatter = formatters . createForPath ( configFile ) ;
260
261
var processedAnswers = processAnswers ( answers , getBasePath ( configFile , cwd ) , testMainFile ) ;
261
262
var configFilePath = path . resolve ( cwd , configFile ) ;
262
263
var testMainFilePath = path . resolve ( cwd , testMainFile ) ;
263
264
265
+ if ( isCoffee ) {
266
+ installPackage ( 'coffee-script' ) ;
267
+ }
268
+
264
269
if ( processedAnswers . generateTestMain ) {
265
270
formatter . writeRequirejsConfigFile ( testMainFilePath ) ;
266
271
console . log ( colorScheme . success (
You can’t perform that action at this time.
0 commit comments