Commit Graph

44 Commits

Author SHA1 Message Date
Richard Gibson
2ea7876c25 Fix #13064: better test fixture cleanup. Close gh-1075. 2012-12-16 13:09:40 -05:00
Timo Tijhof
55313d32a2 Test: Update index.html to new QUnit format. Close gh-1061.
Depends on jquery/sizzle#177, included with the Sizzle submodule in this commit.
2012-12-10 21:48:20 -05:00
Timo Tijhof
cef044d82e 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.
2012-12-10 20:45:20 -05:00
Timo Tijhof
5dd8a90f73 Make compatible with jshint, lint test/data. Close gh-1043. 2012-12-06 13:46:37 -05:00
Richard Gibson
4ada325479 More improvements per @jaubourg 2012-12-03 11:32:19 -05:00
Richard Gibson
ad690f8151 Improvements per @jaubourg 2012-12-03 00:49:40 -05:00
Richard Gibson
5b9bf13439 No ticket: improve global variable/ajax request tracking 2012-12-02 23:32:16 -05:00
jaubourg
b9dfcfd736 sandboxes start for real this time (fixes test failures in IE) 2012-11-27 02:39:08 +01:00
jaubourg
d31cef38f2 Total revamping of the ajax unit tests 2012-11-26 03:31:19 +01:00
Richard Gibson
81b094b2c1 No ticket: update test suite to pass QUnit globals check in most environments. Close gh-1016. 2012-11-05 17:24:03 -05:00
Richard Gibson
14e1501b89 Fix testing of no-ajax custom builds 2012-11-01 00:40:27 -04:00
Timo Tijhof
36c9ecb0f5 Implement expectation test instead of using _removeData. Close gh-997.
* Removed inline usage of QUnit.reset() because it is messing with the
  expectation model as reset does .empty() which does a recursive cleanData
  on everything in #qunit-fixture, so any expectJqData above .reset() would
  fail negatively.

  Instead of calling reset inline, either updated the following assertions to
  take previous assertions' state into account, or broke the test() up into
  2 tests at the point where it would call QUnit.reset.

* After introducing the new memory leak discovery a whole bunch of tests were
  failing as they didn't clean up everything. However I didn't (yet) add
  QUnit.expectJqData calls all over the place because in most if not all of
  these cases it is valid data storage. For example in test "data()", there
  will be an internal data key for "parsedAttrs". This particular test isn't
  intending to test for memory leaks, so therefor I made the new discovery
  system only push failures when the test contains at least 1 call to
  QUnit.expectJqData.

  When not, we'll assume that whatever data is being stored is acceptable
  because the relevant elements still exist in the DOM anyway (QUnit.reset
  will remove the elements and clean up the data automatically).

  I did add a "Always check jQuery.data" mode in the test suite that will
  trigger it everywhere. Maybe one day we'll include a call to everywhere,
  but for now I'm keeping the status quo: Only consider data left in storage
  to be a problem if the test says so ("opt-in").

* Had to move #fx-tests inside the fixture because ".remove()" test would
  otherwise remove stuff permanently and cause random other tests to fail
  as "#hide div" would yield an empty collection.
  (Why wasn't this in the fixture in the first place?)

  As a result moving fx-tests into the fixture a whole bunch of tests failed
  that relied on arbitrary stuff about the document-wide or fixture-wide
  state (e.g. number of divs etc.). So I had to adjust various tests to
  limit their sample data to not be so variable and unlimited...

* Moved out tests for expando cleanup into a separate test.

* Fixed implied global variable 'pass' in effects.js that was causing
  "TypeError: boolean is not a function" in *UNRELATED* dimensions.js that
  uses a global variable "pass = function () {};" ...

* Removed spurious calls to _removeData. The new test exposed various failures
  e.g. where div[0] isn't being assigned any data anyway.
  (queue.js and attributes.js toggleClass).

* Removed spurious clean up at the bottom of test() functions that are
  already covered by the teardown (calling QUnit.reset or removeClass to
  supposedly undo any changes).

* Documented the parentheses-less magic line in toggleClass. It appeared that
  it would always keep the current class name if there was any (since the
  assignment started with "this.className || ...".

  Adding parentheses + spacing is 8 bytes (though only 1 in gzip apparently).
  Only added the comment for now, though I prefer clarity with logical
  operators, I'd rather not face the yayMinPD[1] in this test-related commit.

* Updated QUnit urlConfig to the new format (raw string is deprecated).

* Clean up odd htmlentities in test titles, QUnit escapes this.
  (^\s+test\(.*)(&gt\;) → $1>
  (^\s+test\(.*)(&lt\;) → $1<

[1] jQuery MinJsGz Release Police Department (do the same, download less)
2012-10-28 22:44:57 -04:00
Richard Gibson
c31539c8a2 no ticket: fix jQuery suite failure on Android 2012-10-17 15:20:50 -04:00
Rick Waldron
611d7660cd Remove duplicate expect. Add QUnit.config.requireExpects to testrunner.js QUnit configurations. 2012-10-15 12:31:27 -04:00
Timo Tijhof
7e8b854152 Test: Clean up and fix misc issues
* Clean up testinit and testrunner

* Uncomment isLocal (at least make sure it is declared)

* Rephrase environment assertions to make sense if one reads
  them when they pass.

* Optimise an expensive loop that might be the cause of this
  in IE6: http://cl.ly/image/3f20053m112n
2012-10-09 20:06:31 -04:00
Dave Methvin
2b2ca8baa3 Don't expect QUnit to clean up jQuery internal data. Close gh-883. 2012-08-19 21:09:13 -04:00
Richard Gibson
ff7a434562 Really support subproject tests in testswarm, closes gh-868 2012-07-22 21:49:39 -04:00
Dave Methvin
3016872220 Let subproject tests use their own test fixture. Closes gh-867. 2012-07-19 22:02:37 -04:00
timmywil
37ffb29d37 Relativize all urls pertaining to dist/jquery.js so users can run their server from any file location; Make sure Sizzle is available for its tests in testrunner. 2012-06-04 18:04:11 -04:00
Timo Tijhof
df2a22ee61 Enforce 20s timeout for all unit tests. 2012-04-20 10:55:07 -04:00
Mike Sherov
f35ba5e699 Fix #10691. Remove all instances of equals() and same(), as these are deprecated in QUnit. 2011-11-06 15:27:42 -05:00
timmywil
7bef99e94d Run ajax tests in swarm 2011-10-13 12:07:54 -04:00
timmywil
ea24cd106b Avoid changing html in two places; add minified jQuery as an option to the main test page 2011-05-02 17:53:55 -04:00
timmywil
b8a9c2ba34 Syntax in testrunner 2011-04-28 16:31:51 -04:00
Rick Waldron
ebac797ac2 Landing pull request 354. Adds QUnit Aliases to testrunner.js. Fixes #8991.
More Details:
 - https://github.com/jquery/jquery/pull/354
 - http://bugs.jquery.com/ticket/8991
2011-04-28 15:28:01 -04:00
jzaefferer
646fbea561 Moving jQuery-core specific resets from QUnit to core. 2010-07-27 12:50:08 +02:00
jeresig
298c81a844 Need to expose the isLocal change globally as well. 2010-03-24 16:16:13 -04:00
jeresig
59124f92b5 Temporarily disable ajax tests when running in TestSwam. 2010-03-24 16:04:10 -04:00
jeresig
2301e2a1c3 Update the TestSwarm URL to point to the new jQuery swarm location. 2010-03-23 15:21:42 -04:00
jeresig
f6a50cacd8 Handle auto-running of the TestSwarm injection script in the test suite. 2010-03-23 12:19:47 -04:00
Jörn Zaefferer
db63af1068 core/test: replaced local qunit copy with qunit via svn:externals; inlined styles specific to polluted.php; kept testrunner.js with just the noConflict call 2008-08-08 17:42:52 +00:00
Ariel Flesler
febe463cc2 test runner: closes #3048. The text from the tests, is html-escaped. 2008-06-17 20:11:47 +00:00
Ariel Flesler
9e48649729 test runner: the changes are:
- Replaced all the $ for jQuery in the tests and suite.
- Added a noConflict to testrunner.js.
- Modified the test for noConflict() so that it still work.
- Added jQuery 1.2.1 and 1.2.3 to otherlibs.
2008-05-28 23:18:25 +00:00
Ariel Flesler
16f6b3684d test runner: when errors are thrown in a test, the message is successfully show on all browsers. 2008-05-12 22:31:27 +00:00
Jörn Zaefferer
aec0dad980 jquery core: reverted qunit introduction until build scripts are updated 2008-05-08 21:42:40 +00:00
Jörn Zaefferer
b6bb0d46b6 jquery testsuite: switch to qunit 2008-05-08 19:33:49 +00:00
Jörn Zaefferer
1753ab3d82 jquery testrunner: reset $.ajaxSettings after each run to prevent sideeffects between tests 2008-05-06 19:39:58 +00:00
Jörn Zaefferer
d726a96b1f jquery testrunner: reset global events after each run, speeds up a test run for ajax from 16s to 10s (test/?ajax), kudos to Ariel 2008-05-05 23:29:28 +00:00
Ariel Flesler
ba391eccf9 - Adding the enhancements to the test runner, to accept multiple(and negative) filters from the GET variables, as specified in the ticket #2738. 2008-04-24 21:32:35 +00:00
Jörn Zaefferer
f12d94a628 testrunner: refactored url-test-filter, still regex based 2008-04-24 20:08:50 +00:00
Jörn Zaefferer
f861c88b1b jquery testrunner: accept regexp to select tests, eg. /test/?^core|^selector to run both core and selector module 2008-04-22 22:43:18 +00:00
Jörn Zaefferer
4d13f3701c fixed jsdoc for equals 2007-12-04 16:42:42 +00:00
John Resig
3a4e1233aa Landing the new expando management code. Completely overhauls how data is associated with elements.
Plugins will be most interested in:
- jQuery.data(elem) -> Unique ID for the element
- jQuery.data(elem, name) -> Named data store for the element
- jQuery.data(elem, name, value) -> Saves a value to the named data store
- jQuery.removeData(elem) -> Remove the expando and the complete data store
- jQuery.removeData(elem, name) -> Removes just this one named data store

jQuery's .remove() and .empty() automatically clean up after themselves. Once an element leaves a DOM document their events are no longer intact. Thus, statements like so:
{{{
  $("#foo").remove().appendTo("#bar");
}}}
should be written like so:
{{{
  $("#foo").appendTo("#bar");
}}}
in order to avoid losing the bound events.
2007-09-08 23:31:23 +00:00
John Resig
b4e23b5af0 Reorganzing the jQuery source (first phase). 2007-09-08 12:42:32 +00:00