 
 onErrorContinue = (err) -> console.log(err.stack); @emit 'end'
 task 'mocha', ->  src(files_mocha).pipe(mocha({reporter: 'dot'})).on("error", onErrorContinue)
-
-# removes content for karma, if need, please see the content in project peasy, and rewrite for taijiview.
-#files_karma_debug = 'twoside peasy linepeasy logicpeasy index '+\
-#  merge('samples/ statemachine dsl arithmatic arithmatic2')+' '+\
-#  merge('test/karma/ peasy logicpeasy samples-arithmatic samples-arithmatic samples-arithmatic')
-#files_karma_debug = for item in files_karma_debug.split(' ') then folders_dest+item+'.js'
-#files_karma_dist = 'twoside client/full-peasy-package samples/sample-concat test/karma/karma-concat'
-#files_karma_dist = for item in files_karma_dist.split(' ') then folders_dest+item+'.js'
-#karmaOnce = karma({configFile: folders_dest+'test/karma-conf.js', action: 'run'})
-#task 'karma1', -> src(files_karma_debug).pipe(karmaOnce)
-#task 'karma1/dist', -> src(files_karma_dist).pipe(karmaOnce)
-#karmaWatch = karma({configFile: folders_dest+'test/karma-conf.js', action: 'watch'})
-##console.log files_karma_dist.join(' ')
-#task 'karma', -> src(files_karma_debug).pipe(karmaWatch)
-#task 'karma/dist', -> src(files_karma_dist).pipe(karmaWatch)
 
 task 'runapp', shell.task ['node dist/examples/sockio/app.js']
 task 'express',  ->

task 'watch/all', -> ['watch/copy', 'watch/coffee', 'watch/mocha'] #  , 'watch/reload'

task 'mocha/auto', ['watch/copy', 'watch/coffee', 'watch/mocha']
task 'test', (callback) -> runSequence('make', ['mocha', 'karma1'], callback)
task 'test/dist', (callback) -> runSequence('dist', ['mocha'], callback)   #, 'karma1/dist'
task 'default',['test']



merge = (files) -> files = files.split(' '); path = files[0]; (for file in files.splice(1) then path+file).join(' ')

build = (callback) -> runSequence('clean', ['copy', 'coffee'], callback)
# make is for debugging and test, dont concat and minify
task 'make', (callback) -> distributing = false; build(callback)
# dist is for release, so concat and minify packages
