How to get QUnit to print backtrace for exception?

When an exception occurs in my QUnit tests, all it says is

Died on test #n: message

How do I get it to print backtrace or other location information so that I can see where the exception occurred?

+5
source share
2 answers

I do not think that it is possible to make QUnit give you a trace where the error occurred. Your code threw an exception that QUnit caught and reported. If you check the "notrycatch" checkbox at the top of the QUnit results, your tests will run again, but this time QUnit will not catch an exception. Then your browser can provide you with more information about what actually happened, but it will depend on what happened.

+5

, , . , , , , :

" QUnit ", :

: QUnit, . : qUnit , : , , .

qUnit - , . , , , . , FireBug Safari, .

:

  • ( .) FireBug
  • qUnit , , -
  • ( , for) ,
  • , , , , , ( )

: , , , , . , , , , . , , . (.. - ), , , .

, , , . :

  • , .
  • , , (..). Firebug
  • ,

:

  • ,
  • , , , .

.

- , .

QUnit , jQuery http://docs.jquery.com/Qunit:

QUnit, qunit.js qunit.css HTML :

, , qunit.js qunit.css, , :

<h1 id="qunit-header">QUnit example</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>

, . , , , . :

qUnit test results

qUnit, , .

ok($('.testitem:first').is(':data(droppable)'))

ok($('.testitem:first').is(':data(droppable)'),
    "testitem is droppable after calling setup_items('.testitem')");

, . qUnit , .

0

All Articles