9

I've got a simple TypeError: 'undefined' is not an object failure when running a test in Jasmine headless webkit. But there is no hint in which file or line the error occurs. Is there a way to get a clearer failure message?

Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
  • Do you see any error at all in the browser? Also do you happen to use require.js? I remember seeing the same in the past but can't remember how I resolved it... – ggozad Jun 22 '12 at 18:27
  • The problem is not the error itself but the lossy hint where the error happens. Running the test in the browser will give you the line number anyway, but the question is about a headless webkit. – Andreas Köberle Jun 22 '12 at 18:30

2 Answers2

9

You can use the --runner-out flag to save the HTML from the test. Open this in a browser and you will see the full stacktrace.

jasmine-headless-webkit --runner-out ~/Desktop/jasmine-out.html
Chip
  • 195
  • 1
  • 4
-3

Try debug in Firebug (Firefox) or Google Chrome. Just press F12 and go to scripts pane. I suggest firebug. If that not help you can post your code here or, better, at http://jsfiddle.net

Julio Saito
  • 410
  • 5
  • 9
  • Its not about finding a bug in a normal browser but in a headless webkit turing running a jasmin test, so there is no firebug or developer tools. – Andreas Köberle Jun 20 '12 at 18:38
  • Ok, in this case maybe you should post your issue on github: https://github.com/johnbintz/jasmine-headless-webkit/issues – Julio Saito Jun 21 '12 at 19:54