Skip to content

Commit

Permalink
Output body text when timeout occurs. (Fixes #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
netzpirat committed Nov 5, 2011
1 parent 47b3e36 commit bba335f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/guard/jasmine/phantomjs/run-jasmine.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ waitFor = (test, ready, timeout = 5000) ->
condition = test()
else
if not condition
console.log JSON.stringify({ error: 'Timeout requesting Jasmine test runner!' })
text = page.evaluate -> document.getElementsByTagName('body')[0]?.innerText

if text
error = """
Timeout waiting for the Jasmine test results!
#{ text }
"""
console.log JSON.stringify({ error: error })
else
console.log JSON.stringify({ error: 'Timeout waiting for the Jasmine test results!' })

phantom.exit(1)
else
ready()
Expand Down

0 comments on commit bba335f

Please sign in to comment.