Commit Graph

152 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
d0ce00cdfa
Core: Migrate from AMD to ES modules 🎉
Migrate all source AMD modules to ECMAScript modules. The final bundle
is compiled by a custom build process that uses Rollup under the hood.

Test files themselves are still loaded via RequireJS as that has to work in
IE 11.

Tests can now be run in "Load as modules" mode which replaces the previous
"Load with AMD" option. That option of running tests doesn't work in IE
and Edge as it requires support for dynamic imports.

Some of the changes required by the migration:
* check `typeof` of `noGlobal` instead of using the variable directly
  as it's not available when modules are used
* change the nonce module to be an object as ECMASscript module exports
  are immutable
* remove some unused exports
* import `./core/parseHTML.js` directly in `jquery.js` so that it's not
  being cut out when the `ajax` module is excluded in a custom compilation

Closes gh-4541
2019-11-18 21:15:03 +01:00
Michał Gołębiowski-Owczarek
d7e64190ef
Build: Remove the external directory, read from node_modules directly
Now that Sizzle is gone & we use npm, we can read from node_modules directly
and skip the setup that copies some files to the external directory.

Closes gh-4466
2019-08-26 18:53:54 +02:00
Michał Gołębiowski-Owczarek
6ced2639b5
Build: Update QUnit from 1.23.1 to 2.9.2
Closes gh-4307
2019-03-04 20:10:21 +01:00
Timo Tijhof
ecd8ddea33
Tests: Add support for running unit tests via grunt with karma
- Update QUnit to 1.23.1
- Remove unused dl#dl from test/index.html
- Remove unused map#imgmap from test/index.html
- Ensure all urls to data use baseURI
- Add the 'grunt karma:main' task
  - customContextFile & customDebugFile
- Add 'npm run jenkins' script

Close gh-3744
Fixes gh-1999
2017-12-18 12:27:38 -05:00
Richard Gibson
deba37e53d Tests: Simulate events when CI hinders use of native ones
Ref gh-3732
2017-07-20 13:16:04 -04:00
Michał Gołębiowski
67c96a59f5 Build: Update npm deps, fix Sinon npmcopy config
All deps were updated except:
 * jsdom - tests using a Symbol polyfill are hacky and break with newer jsdom;
   we need to re-do them properly first
 * qunitjs - versions 1.19.0 & 1.20.0 introduce race conditions to the tests,
   making the fail randomly

Those two packages will be updated once issues related to them get resolved.

Fixes gh-2877
2016-01-27 12:54:39 +01:00
Henry Wong
1712457fbc Tests: fixed grammar in comment
Close gh-2757
2016-01-13 13:20:20 -05:00
Thomas Tortorini
3dd3d1357d Effects: Finish should call progress
Fixes gh-2283
Closes gh-2292
2015-09-08 02:40:54 +02:00
Corey Frang
cdaed15c7e Effects: Add tests for jQuery.Tween 2015-06-26 20:05:25 -04:00
Gabriel Schulhof
7475d5debe Event: Remove fake originalEvent from jQuery.Event.simulate
Fixes gh-2300
Closes gh-2303
2015-05-29 19:56:06 +03:00
Richard Gibson
555a50d340 Deferred: Backwards-compatible standards interoperability
Fixes gh-1722
Closes gh-1996
2015-03-20 02:00:17 -04:00
Oleg Gaidarenko
8356281bed Tests: make top of the HTML suite compliant with style guide
See http://contribute.jquery.org/style-guide/html/

Closes gh-2098
2015-02-19 11:30:57 +03:00
Scott González
c5d9d88dce Build: Move all external libraries to external directory
Closes gh-1593
2014-06-24 10:17:50 -04:00
Dave Methvin
6bff3bf7d7 Tests: Remove html5 shiv 2014-01-09 22:36:07 -05:00
Timmy Willison
f9ad13c9ec Manage bower dependencies with grunt-bowercopy
Tracked bower dependencies are located at "src/sizzle" and "test/libs".
The source-destination mapping is in the Gruntfile.

When updating a bower dependency, update the version in bower.json, run
`grunt bower`, and then commit the result. When adding a dependency,
update the bowercopy task accordingly.

Fixes #14615.
Closes gh-1452.
2013-12-06 16:04:35 -05:00
John Paul
b407bddea2 Effects: Integrate sinon fake timers into tests. Close gh-1377. 2013-11-24 15:22:09 -05:00
Timmy Willison
ac7ff97f8b Use grunt and bower packages as local dependencies. Close gh-1433. 2013-11-14 10:17:18 -05:00
Oleg
626cbde7f8 Use full version of jQuery 1.9.1
Had some weird failures in IE with xhr build of 1.9.1
2013-11-08 01:04:08 +01:00
Timmy Willison
5093b89f08 Convert testrunner to an AMD module and ensure jQuery is on the page when executing the testrunner (another race condition amplified by swarm) 2013-09-06 17:11:32 -04:00
Timmy Willison
e563cd3414 Move test loader to testinit.js. Fix race condition with dependency loading. 2013-09-06 16:23:20 -04:00
Timmy Willison
6535cc599e Use requirejs to load the testswarm inject script 2013-09-06 15:44:59 -04:00
Timmy Willison
004c1fc5bb Pass all tests (and load Sizzle fixture correctly) when loading with AMD 2013-08-29 16:18:17 -04:00
Oleg Gaidarenko
70c9a0a13a Fixed pulling in Sizzle subproject when testing with min/dev. 2013-08-16 09:43:43 -04:00
Timmy Willison
6318ae6ab9 AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163. 2013-08-15 14:15:49 -04:00
Oleg
c8c32f1d05 Fix paths for qunit files 2013-07-24 18:39:09 +04:00
Timmy Willison
b13d8229ae Include Sizzle and Qunit with bower. Fixes #14118. 2013-07-10 12:00:26 -04:00
Richard Gibson
db0326b1fd Fix #13596; #13722: .replaceWith consistency. Close gh-1216. 2013-04-16 17:47:21 -04:00
Oleg Gaidarenko
f1ba486ee3 Adjust tabIndex propHook for modern browsers and return -1 where appropriate. Close gh-1228. 2013-04-08 21:33:17 -04:00
Michał Gołębiowski
bea0d9a49d Separate test/unit/wrap.js; make tests not fail when wrap module excluded 2013-04-09 00:00:02 +02:00
Richard Gibson
b734666f4d Fix #13265 #13332: traversing methods with text nodes. Close gh-1145. 2013-02-13 22:03:37 -05:00
Richard Gibson
363299ac24 Ref #13316: Sync all documents on full vs. minified source. Close gh-1147. 2013-02-07 15:16:28 -05:00
Oleg
f3db084f7c Fix #13310. Get the right display value for disconnected nodes. Close gh-1156. 2013-02-04 15:22:07 -05:00
Timmy Willison
f3ce0e696d Revert change to visible/hidden selectors until 1.10 and 2.1. Reopens #13132, #10406. 2013-01-30 20:37:13 -05:00
Dave Methvin
58cd84f9d5 Fix #13316. Use minified version in unit testing. 2013-01-26 10:48:10 -05:00
Timmy Willison
b326225d90 Fix failing tests, add support for empty spans in Opera. Supplements #13132, #10406. 2013-01-21 18:03:07 -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
Richard Gibson
d08d48337f update Sizzle 2012-11-16 15:57:43 -05:00
Richard Gibson
48bd8b509b No ticket: speedup effects tests 2012-11-12 21:06:16 -05:00
Richard Gibson
14e1501b89 Fix testing of no-ajax custom builds 2012-11-01 00:40:27 -04:00
Timo Tijhof
6e75fe5f19 No ticket: fix effects test failure in IE6. Close gh-1012. 2012-10-31 16:41:31 -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
Dave Methvin
2a1e5eccf5 Shim/shiv the datalist element for crabby Uncle oldIE. 2012-09-05 22:01:35 -04:00
Dave Methvin
3016872220 Let subproject tests use their own test fixture. Closes gh-867. 2012-07-19 22:02:37 -04:00
jaubourg
ced5e9037a Extracts the serialization code from the ajax module so that alternative ajax implementations can use it without the need for the whole ajax module to be included in the build. 2012-07-13 09:47:43 +02:00
Nowres Rafid
aaf134bb70 Fix #8482, offsetParent should not return null. Closes gh-847. 2012-07-06 10:01:32 -04:00
timmywil
ad2221853f Update Sizzle: reduced size. Add Sizzle's utilities.js to unit tests 2012-06-27 00:41:33 -04:00
Rick Waldron
a2758377df Adds src/deprecated.js, test/unit/deprecated.js; -deprecated flag; Moves jQuery.browser and removes use in test/unit/ajax.js. Fixes #11965 2012-06-25 10:02:28 -04:00
Dave Methvin
a416e2ba0d Ensure that IE stays in Big Boy mode.
Although we use a lot of iframes in the test, the IE document mode is set by the parent document so we just need a single X-UA-Compatible in the main file.

http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx
2012-06-16 10:57:41 -04:00
Scott González
a7430dfb12 Use QUnit's URL configs to simplify custom configuration. Closes gh-827 2012-06-15 08:23:42 -05:00
timmywil
8f944a1b5c Add necessary test html from Sizzle tests; Add an easy way to turn off QSA in tests 2012-06-15 02:09:38 -04:00