fixing 'cake test' to print out the name of the file with the failing test.

This commit is contained in:
Jeremy Ashkenas 2010-03-14 09:33:41 -07:00
parent 74995358cd
commit a27f146338
1 changed files with 6 additions and 2 deletions

View File

@ -81,6 +81,10 @@ task 'test', 'run the CoffeeScript language test suite', ->
time: ((new Date() - start_time) / 1000).toFixed(2)
puts '\033[0;32mpassed ' + test_count + ' tests in ' + time + ' seconds\033[0m'
fs.readdir 'test', (err, files) ->
for file in files
files.forEach (file) ->
fs.readFile 'test/' + file, (err, code) ->
CoffeeScript.run code, {source: file}
try
CoffeeScript.run code, {source: file}
catch err
puts "Failed test: $file"
throw err