diff options
author | jrburke <jrburke@gmail.com> | 2011-09-19 16:37:22 -0400 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2011-09-19 16:37:22 -0400 |
commit | bba3d610c7e3b611fe1eb89178c91106a156a5dc (patch) | |
tree | 1fc512ad444a499ee81a10823b4104f0382eabf6 /test | |
parent | 2831cfd072125a51f454346211666c9e11641474 (diff) | |
parent | 0b1c2e642ac0267b95759b2a7593a7d19aa43c9c (diff) | |
download | jquery-bba3d610c7e3b611fe1eb89178c91106a156a5dc.tar.gz jquery-bba3d610c7e3b611fe1eb89178c91106a156a5dc.zip |
Landing pull request 331. Add support for registering jQuery as an AMD module. Fixes #7102.
More Details:
- https://github.com/jquery/jquery/pull/331
- http://bugs.jquery.com/ticket/7102
Diffstat (limited to 'test')
-rw-r--r-- | test/data/testinit.js | 14 | ||||
-rw-r--r-- | test/unit/core.js | 6 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js index c30747d09..7d566faa5 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -1,7 +1,19 @@ var jQuery = this.jQuery || "jQuery", // For testing .noConflict() $ = this.$ || "$", originaljQuery = jQuery, - original$ = $; + original$ = $, + amdDefined; + +/** + * Set up a mock AMD define function for testing AMD registration. + */ +function define(name, dependencies, callback) { + amdDefined = callback(); +} + +define.amd = { + jQuery: true +}; /** * Returns an array of elements with the given IDs, eg. diff --git a/test/unit/core.js b/test/unit/core.js index 50157fa48..0f4504a13 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -225,6 +225,12 @@ test("browser", function() { }); } +test("amdModule", function() { + expect(1); + + equals( jQuery, amdDefined, "Make sure defined module matches jQuery" ); +}); + test("noConflict", function() { expect(7); |