Skip to content
Permalink
Browse files

Test: Remove fixtures from QUnit.done hook. Close gh-1069.

This fixes jquery/testswarm#197. These are currently removed from
the TestSwarm injector, however this is jQuery specific, and
should be done from this end instead.
  • Loading branch information
Krinkle authored and dmethvin committed Dec 11, 2012
1 parent 3c7f2af commit cef044d82ec0d338b2b69756d3ba08692fb80ae4
Showing with 5 additions and 0 deletions.
  1. +5 −0 test/data/testrunner.js
@@ -316,6 +316,11 @@ var Globals = (function() {
}
};

QUnit.done(function() {
// Remove out own fixtures outside #qunit-fixture
jQuery( "#nothiddendiv, #loadediframe, #dl" ).remove();

This comment has been minimized.

Copy link
@gibson042

gibson042 Dec 11, 2012

Member

Can you describe what's going on here? It's not removing all of our elements (see test/index.html), but it is hitting most of them. Should we make this jQuery("#qunit ~ *").remove()?

This comment has been minimized.

Copy link
@Krinkle

Krinkle Dec 11, 2012

Author Member

These are the ones we currently hardcode in TestSwarm itself. After QUnit is done, TestSwarm's client script removes these elements before making a snapshot of the DOM to push to the results object in TestSwarm for this run.

I moved that logic to here, to then remove that logic from TestSwarm. Feel free to update it (until it recently even #main was still listed here, from the-ages-ago-version of QUnit). For example, #nothiddendiv is now in #qunit-fixture and no longer needs to be explicitly cleaned up.

This comment has been minimized.

Copy link
@dmethvin

dmethvin Dec 11, 2012

Member

In that case it sounds like we probably should use jQuery("#qunit ~ *").remove() although as long as the elements are hidden it probably doesn't make a difference.

});

// jQuery-specific QUnit.reset
QUnit.reset = function() {

0 comments on commit cef044d

Please sign in to comment.
You can’t perform that action at this time.