diff options
author | timmywil <timmywillisn@gmail.com> | 2012-05-29 12:40:13 -0400 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2012-05-29 13:13:26 -0400 |
commit | a8d9d05388465b16880be43629af008ff19b7725 (patch) | |
tree | d917fe6deeb8678aeba38ccd1e9117cff07c808f /test/data/testinit.js | |
parent | 02dd7c570bf4dbbdfc168f4352d04c667447be5d (diff) | |
download | jquery-a8d9d05388465b16880be43629af008ff19b7725.tar.gz jquery-a8d9d05388465b16880be43629af008ff19b7725.zip |
Add quick-start documentation for testing with QUnit and using jQuery's helper methods.
Diffstat (limited to 'test/data/testinit.js')
-rw-r--r-- | test/data/testinit.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js index 9fc91ffb5..f2898e0ba 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -10,7 +10,7 @@ var jQuery = this.jQuery || "jQuery", // For testing .noConflict() /** * Set up a mock AMD define function for testing AMD registration. */ -function define(name, dependencies, callback) { +function define( name, dependencies, callback ) { amdDefined = callback(); } @@ -19,7 +19,7 @@ define.amd = { }; /** - * Returns an array of elements with the given IDs, eg. + * Returns an array of elements with the given IDs * @example q("main", "foo", "bar") * @result [<div id="main">, <span id="foo">, <input id="bar">] */ @@ -34,10 +34,11 @@ function q() { } /** - * Asserts that a select matches the given IDs * @example t("Check for something", "//[a]", ["foo", "baar"]); + * Asserts that a select matches the given IDs * @param {String} a - Assertion name * @param {String} b - Sizzle selector * @param {String} c - Array of ids to construct what is expected + * @example t("Check for something", "//[a]", ["foo", "baar"]); * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar' */ function t( a, b, c ) { @@ -113,7 +114,7 @@ if ( document.createEvent ) { } /** - * Add random number to url to stop IE from caching + * Add random number to url to stop caching * * @example url("data/test.html") * @result "data/test.html?10538358428943" @@ -121,7 +122,7 @@ if ( document.createEvent ) { * @example url("data/test.php?foo=bar") * @result "data/test.php?foo=bar&10538358345554" */ -function url(value) { +function url( value ) { return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); } |