Skip to content
Browse files

dont do coverage when no index.js specified

  • Loading branch information...
1 parent 2bf73a6 commit d9ce3acebb1a9258956c39b09cd6dfeb28b19e00 @matthiasg committed
Showing with 18 additions and 8 deletions.
  1. +17 −7 lib/ariel.coffee
  2. +1 −1 package.json
View
24 lib/ariel.coffee
@@ -212,8 +212,6 @@ runTests = (cbFinished) ->
runCoveraje = (withServer, cbFinished) ->
- console.log 'running coverage...'.green
-
runSingleTest = (file) ->
return (context) ->
console.log "running helper #{file}"
@@ -240,12 +238,24 @@ runCoveraje = (withServer, cbFinished) ->
rel = rel.replace(backslashRegExp,'/')
indexPath = "#{rel}/index.js"
+
+ if not path.existsSync(indexPath)
+ console.log 'skipping coverage (no index.js)'.green
+ cbFinished() if cbFinished
+ return
+
code = "var root = require('#{indexPath}');"
- coveraje.cover code, runner, opts
- isCoverageServerStarted = withServer
+ finished = (instance) ->
+ console.log( instance.report("default") )
+ cbFinished() if cbFinished
+
+ console.log 'running coverage...'.green
+ coveraje.cover code, runner, opts, finished
+ isCoverageServerStarted = withServer
+
+ console.log 'started coverage testing ... '.green
- cbFinished() if cbFinished
gatherTestFiles = (rootDirPath, testDir) ->
@@ -298,8 +308,8 @@ runMocha = (cbFinished)->
proc.on 'exit', ->
#tty.setRawMode(false);
- process.stdout.resume()
- process.stderr.resume()
+ #process.stdout.resume()
+ #process.stderr.resume()
console.log()
console.log "Testing completed.".green
View
2 package.json
@@ -2,7 +2,7 @@
"author": "Matthias Goetzke <m.goetzke@curasystems.de> (https://twitter.com/mgoetzke)",
"name": "ariel",
"description": "continuously test and cover files using mocha and coveraje. Note: ariel requires an index.js in root as entry point for now.",
- "version": "0.0.8",
+ "version": "0.0.9",
"homepage": "https://github.com/matthiasg/node-ariel",
"repository": {
"type": "git",

0 comments on commit d9ce3ac

Please sign in to comment.
Something went wrong with that request. Please try again.