jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

How to get verbose error output #247

Closed phlppn closed 10 years ago

phlppn commented 10 years ago

I am using teaspoon with qunit and phantomjs. When a run a simple unit test like this:

equal(someArray.length, 6, "Array length is 6");

and it fails, i dont get any information about the File / Line and the actual value of someArray. I just get something like that:

F

Failures:

  1)Something loadMoreItems (1, 1, 2)
     Failure/Error: Array length is 6

Finished in 0.02000 seconds
1 example, 1 failure

How do i get more information about where the error happened and what the actual compared values are?

jejacks0n commented 10 years ago

You can't really.. with sprockets the files can be combined into different files, so the filename is a) not always accurate, b) impossible to get without raising an exception (and even still unreliable with passing that around).

If you know of a way to accomplish this in javascript I'd be interested in how you can accomplish it.