qunit reports results before execution is finished -


i'm still new qunit. there's snippet

<body>   <div id=qunit></div>   <div id=qunit-fixture>   ..   <a title=something href=#>foo</a>   </div> 

and corresponding test case contains

$( 'a').each( function() {    console.debug( this);   // } ); 

however, qunit inserts results in #qunit, including hyperlinks, in turn appear in test case (inside each). obviously, content inserted qunit should outside test's scope. suggestion how avoid this?

qunit deals having place html test needs inside qunit-fixture element, instead of:

$('a').each(function() { ... });

you do:

$('#qunit-fixture a').each(function() { ... });

in test case.

this lets isolate tests without depending on other page contents. qunit documentation provides more information this methodology.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -