aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/traversing.js
Commit message (Collapse)AuthorAgeFilesLines
* Tests: replace dead links in qunit fixtureTimmy Willison2024-08-121-16/+16
| | | Close gh-5532
* Build: improve specificity of eslint config; add ecma versionsTimmy Willison2024-06-061-1/+1
| | | Closes gh-5501
* Build: migrate most grunt tasks off of gruntTimmy Willison2023-09-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Updated tasks include: - lint - npmcopy - build, minify, and process for distribution. - new custom build command using yargs - compare size of minified/gzip built files - pretest scripts, including qunit-fixture, babel transpilation, and npmcopy - node smoke tests - promises aplus tests - new watch task using `rollup.watch` directly Also: - upgraded husky and added the new lint command - updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new - Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See https://github.com/import-js/eslint-plugin-import/issues/2556 - committed package-lock.json - updated all test scripts to use the new build - added an express test server that uses middleware-mockserver (this can be used to run tests without karma) - build-all-variants is now build:all Close gh-5318
* Docs: Fix typos found by codespellDimitri Papadopoulos Orfanos2023-06-281-2/+2
| | | Closes gh-5165
* Selector: Backport jQuery selection context logic to selector-nativeMichał Gołębiowski-Owczarek2023-02-131-8/+16
| | | | | | | | | | | | | | | | | | | | | | This makes: ```js $div.find("div > *") ``` no longer matching children of `$div`. Also, leading combinators now work, e.g.: ```js $div.find( "> *" ); ``` returns children of `$div`. As a result of that, a number of tests are no longer skipped in the `selector-native` mode. Also, rename `rcombinators` to `rleadingCombinator`. Fixes gh-5185 Closes gh-5186 Ref gh-5085
* Docs: Replace `#NUMBER` Trac issue references with `trac-NUMBER`Michał Gołębiowski-Owczarek2022-01-041-13/+13
| | | | | | | | | | | | | The GitHub UI treats `#NUMBER` as referring to its own issues which is confusing when in jQuery source it's usually referring to the old deprecated Trac instance at https://bugs.jquery.com. This change replaces all such Trac references with `trac-NUMBER`. A few of the references came with the Sizzle integration and referred to the Sizzle GitHub bug tracker. Those have been replaced with full links instead. A new entry describing issue reference conventions has been added to README. Closes gh-4993
* Manipulation: Make jQuery.htmlPrefilter an identity functionMichał Gołębiowski-Owczarek2020-03-161-11/+11
| | | Closes gh-4642
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-291-11/+11
| | | | | | | | | | | | | | | | | | This commit removes Sizzle from jQuery, inlining its code & removing obsolete workarounds where applicable. The selector-native module has been removed. Further work on the selector module may decrease the size enough that it will no longer be necessary. If it turns out it's still useful, we'll reinstate it but the code will look different anyway as we'll want to share as much code as possible with the existing selector module. The Sizzle AUTHORS.txt file has been merged with the jQuery one - people are sorted by their first contributions to either of the two repositories. The commit reduces the gzipped jQuery size by 1460 bytes compared to master. Closes gh-4395
* Selector: Port Sizzle tests to jQueryMichał Gołębiowski-Owczarek2019-06-261-9/+68
| | | | | | | Apart from porting most Sizzle tests to jQuery (mostly to its selector module), this commit fixes selector-native so that a jQuery custom compilation that excludes Sizzle passes all tests as well. Closes gh-4406
* Core: Remove IE-specific support tests, rely on document.documentModeMichał Gołębiowski-Owczarek2019-05-131-1/+1
| | | | | | | Also, update some tests to IE-sniff when deciding whether to skip a test. Fixes gh-4386 Closes gh-4387
* Traversing: Fix `contents()` on `<object>`s with childrenPat O'Callaghan2019-05-061-0/+13
| | | | Fixes gh-4384 Closes gh-4385
* Build: Update test code for compatibility with QUnit 2.x (#4297)abnud12019-02-181-1/+1
| | | | | | | | Also, run `grunt npmcopy` to sync the "external" directory with dependencies from package.json. For example, the Sinon library version didn't match. Ref gh-4234 Closes gh-4297
* Traversing: $.fn.contents() support for objectLuis Emilio Velasco Sanchez2018-05-141-38/+68
| | | | | Fixes gh-4045 Closes gh-4046
* Tests: skip test with invalid selector for selector-native testsTimmy Willison2018-01-191-1/+1
|
* Tests: Add support for running unit tests via grunt with karmaTimo Tijhof2017-12-181-5/+5
| | | | | | | | | | | | | - 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
* Traversing: $.fn.contents() supports HTMLTemplateElement南漂一卒2017-01-291-0/+52
| | | | | Fixes gh-3436 Closes gh-3462
* Traversing: Let .not(arraylike) pass non-element nodesDave Methvin2016-08-101-0/+14
| | | | | Fixes gh-3226 Closes gh-3261
* Tests: fix another traverse testOleg Gaidarenko2016-01-311-1/+5
| | | | | | | Tricky test - if isolated, was executed fine, but falling if runned with other tests Ref b97c8d30c5aedace75dc17056d429f28e41b20c1
* Tests:Build: update qunit and fix incorrect testOleg Gaidarenko2016-01-291-2/+25
| | | | | | * Update QUnit to the latest version (1.20.0) * Corrected test was dependent on QUnit UI, which is always a bad idea
* Traversing: Never let .closest() match positional selectorsRichard Gibson2016-01-131-4/+17
| | | | | Fixes gh-2796 Close gh-2818
* Traversing: .not/.filter consistency with non-elementsMartijn W. van der Lee2016-01-131-0/+11
| | | | | Fixes gh-2808 Close gh-2809
* Selector: pass jQuery unit tests with selector-nativeTimmy Willison2015-11-111-15/+19
| | | | | | | | | - Ignore certain tests that obviously are not supported - Beefed up the sortOrder, uniqueSort, isXMLDoc, and attr functions Fixes gh-1742 Fixes gh-2048 Close gh-2703
* Tests: further improvements QUnit 2.0 migrationOleg Gaidarenko2015-09-081-1/+1
| | | | | | | | * Remove QUnit jshint globals * Extend QUnit.assert methods * Use assert.async instead of start/stop/done Ref b930d14ce64937e9478405eee2828d4da091d2cb
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-524/+522
| | | | Fixes gh-2056
* Tests: partially use new qunit interfaceOleg Gaidarenko2015-08-161-408/+408
| | | | | | | | | | | | http://qunitjs.com/upgrade-guide-2.x/ For most of the boring work was used https://github.com/apsdehal/qunit-migrate package However, it can't update local qunit helpers, plus in some places old QUnit.asyncTest signature is still used Fixes gh-2540
* Selector: add jQuery.uniqueSort; deprecate jQuery.uniqueTimmy Willison2015-05-041-1/+1
| | | | Fixes gh-2228
* Build: fix broken assertions caused by QUnit updateOleg Gaidarenko2015-02-151-1/+1
| | | | | | | | QUnit update broke couple traversing and manipulation tests, since new qunit added another form to the test-suite while some of jQuery selectors weren't specific Ref 2d5c5d213f09fa0205d07a2d60a36581058cc40a
* Traversing: Check all pairwise element combinations for .find( els )Richard Gibson2014-01-171-2/+4
| | | | | Ref b8d0d54a3c4960794a1b492957abeb56eddd1e48 Fixes #14701
* traversing: Optimise .add by not using makeArrayTimo Tijhof2013-12-301-27/+111
| | | | Closes gh-1430
* Fix #13846: .prev sort directionRichard Gibson2013-05-011-1/+1
|
* Fix #13819: .parent sort directionRichard Gibson2013-04-241-0/+26
| | | | (cherry picked from commit 6a816ec95fd96d130a4af67a28873d9daa66a328)
* Fix #13797: .is with single-node contextRichard Gibson2013-04-201-9/+18
| | | | (cherry picked from commit 4f786ba4d2a5544cb48f589d2659d6cab84efc34)
* Update jshintrc to conform to new style guide. Conform to onevar and unused ↵Timmy Willison2013-04-091-20/+31
| | | | in tests. Fixes #13755.
* Move size() test to deprecated.js and avoid in other tests. Close gh-1237.Michał Gołębiowski2013-04-081-13/+15
|
* Fix #13539: Utilize Sizzle hooks. Close gh-1215.Richard Gibson2013-04-051-4/+35
| | | | (cherry picked from commit 4ef516903e6e48bce388ca47c1ed88a447199fa1)
* Fix typos. Close gh-1186.dmitrygusev2013-02-281-8/+8
|
* Ref #13283, move .andSelf() to deprecated.js. Close gh-1170.Nguyen Phuc Lam2013-02-261-2/+2
|
* No ticket: Revise unit tests in anticipation of Sizzle-free buildsRichard Gibson2013-02-221-54/+80
|
* Fix #13265 #13332: traversing methods with text nodes. Close gh-1145.Richard Gibson2013-02-131-12/+32
|
* Reduce traversing moduleOleg2012-12-191-2/+7
|
* Fix #11115: Normalize boolean attributes/properties. Close gh-1066.Richard Gibson2012-12-151-1/+5
|
* Adjust jQuery('html') detection to only match when html starts with '<' (not ↵timmywil2012-12-131-1/+1
| | | | counting space characters). Fixes #11290.
* Test: Update index.html to new QUnit format. Close gh-1061.Timo Tijhof2012-12-101-6/+6
| | | | Depends on jquery/sizzle#177, included with the Sizzle submodule in this commit.
* Test case for #12816Dave Methvin2012-10-311-1/+3
|
* Fix #12009. $().find( DOMElement ) should pushStack properly. Close gh-927.Mike Sherov2012-10-301-11/+13
|
* Implement expectation test instead of using _removeData. Close gh-997.Timo Tijhof2012-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)
* Update Sizzle: allows disconnected sorting. Change add to always sort with ↵Timmy Willison2012-10-161-6/+3
| | | | added nodes, even when disconnected.
* Return correct index for no-arg index() calls. Fixes #10977. Closes gh-971MORGAN2012-10-161-0/+9
|
* enforce double quotes via JSHint. Closes gh-975Mike Sherov2012-10-161-11/+11
|
* Enforce expects in events.js ↵James Huston2012-10-151-1/+3
| | | | (https://github.com/jquery/2012-dev-summit/issues/53) Closes gh-962