aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/testinit.js
Commit message (Collapse)AuthorAgeFilesLines
* Tests: reuse browser workers in BrowserStack tests (#5428)Timmy Willison2024-03-051-1/+0
| | | | | | | | | - reuse BrowserStack workers. - add support for "latest" and "latest-1" in browser version filters - add support for specifying non-final browser versions, such as beta versions - more accurate eslint for files in test/runner - switched `--no-isolate` command flag to `--isolate`. Now that browser instances are shared, it made more sense to me to default to no isolation unless specified. This turned out to be cleaner because the only place we isolate is in browserstack.yml. - fixed an issue with retries where it wasn't always waiting for the retried test run - enable strict mode in test yargs command
* Tests: migrate testing infrastructure to minimal dependenciesTimmy Willison2024-02-261-34/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a complete rework of our testing infrastructure. The main goal is to modernize and drop deprecated or undermaintained dependencies (specifically, grunt, karma, and testswarm). We've achieved that by limiting our dependency list to ones that are unlikely to drop support any time soon. The new dependency list includes: - `qunit` (our trusty unit testing library) - `selenium-webdriver` (for spinning up local browsers) - `express` (for starting a test server and adding middleware) - express middleware includes uses of `body-parser` and `raw-body` - `yargs` (for constructing a CLI with pretty help text) - BrowserStack (for running each of our QUnit modules separately in all of our supported browsers) - `browserstack-local` (for opening a local tunnel. This is the same package still currently used in the new Browserstack SDK) - We are not using any other BrowserStack library. The newest BrowserStack SDK does not fit our needs (and isn't open source). Existing libraries, such as `node-browserstack` or `browserstack-runner`, either do not quite fit our needs, are under-maintained and out-of-date, or are not robust enough to meet all of our requirements. We instead call the [BrowserStack REST API](https://github.com/browserstack/api) directly. ## BrowserStack Runner - automatically retries individual modules in case of test failure(s) - automatically attempts to re-establish broken tunnels - automatically refreshes the page in case a test run has stalled - runs all browsers concurrently and uses as many sessions as are available under the BrowserStack plan. It will wait for available sessions if there are none. - supports filtering the available list of browsers by browser name, browser version, device, OS, and OS version (see `npm run test:unit -- --list-browsers` for more info). It will retrieve the latest matching browser available if any of those parameters are not specified. - cleans up after itself (closes the local tunnel, stops the test server, etc.) - Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables. ## Selenium Runner - supports running any local browser as long as the driver is installed, including support for headless mode in Chrome, FF, and Edge - supports running `basic` tests on the latest [jsdom](https://github.com/jsdom/jsdom#readme), which can be seen in action in this PR (see `test:browserless`) - Node tests will run as before in PRs and all non-dependabot branches, but now includes tests on real Safari in a GH actions macos image instead of playwright-webkit. - can run multiple browsers and multiple modules concurrently Other notes: - Stale dependencies have been removed and all remaining dependencies have been upgraded with a few exceptions: - `sinon`: stopped supporting IE in version 10. But, `sinon` has been updated to 9.x. - `husky`: latest does not support Node 10 and runs on `npm install`. Needed for now until git builds are migrated to GitHub Actions. - `rollup`: latest does not support Node 10. Needed for now until git builds are migrated to GitHub Actions. - BrowserStack tests are set to run on each `main` branch commit - `debug` mode leaves Selenium browsers open whether they pass or fail and leaves browsers with test failures open on BrowserStack. The latter is to avoid leaving open too many sessions. - This PR includes a workflow to dispatch BrowserStack runs on-demand - The Node version used for most workflow tests has been upgraded to 20.x - updated supportjQuery to 3.7.1 Run `npm run test:unit -- --help` for CLI documentation Close gh-5418
* CSS: Fix reliableTrDimensions support test for initially hidden iframesMichał Gołębiowski-Owczarek2023-11-071-1/+6
| | | | | Closes gh-5358 Ref gh-5317 Ref gh-5359
* Core: Simplify code post browser support reductionMichał Gołębiowski-Owczarek2023-09-201-10/+6
| | | | | | | | | | | | | | | | | Summary of the changes: * Core: Simplify code post browser support reduction * Tests: Remove legacy jQuery.cache & oldIE leftovers * Tests: Reformat JavaScript in delegatetest.html * Docs: "jQuery Foundation Projects" -> "jQuery Projects" * Tests: Drop an unused localfile.html file (modern browsers don't support the `file:` protocol this way, there's no point in keeping the file around) * Effects: Remove a redundant `!fn` check (`fn || !fn && easing` is equivalent to `fn || easing`; simplify the code) * CSS: Explain the fallback to direct object access in curCSS better * Tests: Deduplicate `jQuery.parseHTML` test titles * Dimensions: Add a test for fractional values * Tests: Fix a buggy WebKit regex Closes gh-5296
* Build: migrate most grunt tasks off of gruntTimmy Willison2023-09-181-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Build: Drop individual AMD modulesMichał Gołębiowski-Owczarek2023-06-271-3/+2
| | | | | | | | | | With this change, jQuery build no longer generates the `amd` directory with AMD modules transpiled from source `src` ECMAScript Modules. To use individual jQuery modules from source, ESM is now required. Note that this DOES NOT affect the main `"jquery"` AMD module defined by built jQuery files; those remain supported. Closes gh-5276
* Ajax: Support binary data (including FormData)Michał Gołębiowski-Owczarek2023-02-011-2/+5
| | | | | | | | | | | | Two changes have been applied: * prefilters are now applied before data is converted to a string; this allows prefilters to disable such a conversion * a prefilter for binary data is added; it disables data conversion for non-string non-plain-object `data`; for `FormData` bodies, it removes manually-set `Content-Type` header - this is required as browsers need to append their own boundary to the header Ref gh-4150 Closes gh-5197
* Selector: Re-introduce selector-native.jsMichał Gołębiowski-Owczarek2022-11-211-11/+12
| | | | | | | | | | | | | | | | | | | | | Re-introduce the `selector-native` similar to the one on the `3.x-stable` branch. One difference is since the `main` branch inlined Sizzle, some selector utils can be shared between the main `selector` module and `selector-native`. The main `selector` module can be disabled in favor of `selector-native` via: grunt custom:-selector Other changes: * Tests: Fix Safari detection - Chrome Headless has a different user agent than Safari and a browser check in selector tests didn't take that into account. * Tests: Run selector-native tests in `npm test` * Selector: Fix querying on document fragments Ref gh-4395 Closes gh-5085
* Tests: Exclude tests based on compilation flags, not API presenceMichał Gołębiowski-Owczarek2022-06-281-1/+62
| | | | | | | | | | Introduces a new test API, `includesModule`. The method returns whether a particular module like "ajax" or "deprecated" is included in the current jQuery build; it handles the slim build as well. The util was created so that we don't treat presence of particular APIs to decide whether to run a test as then if we accidentally remove an API, the tests would still not fail. Fixes gh-5069 Closes gh-5046
* Tests: Load the TestSwarm listener via HTTPSMichał Gołębiowski-Owczarek2021-09-291-1/+1
|
* Manipulation: Make jQuery.htmlPrefilter an identity functionMichał Gołębiowski-Owczarek2020-03-161-1/+1
| | | Closes gh-4642
* Core: Fire iframe script in its context, add doc param in globalEvalMichał Gołębiowski-Owczarek2020-02-101-4/+16
| | | | | | | | | | 1. Support passing custom document to jQuery.globalEval; the script will be invoked in the context of this document. 2. Fire external scripts appended to iframe contents in that iframe context; this was already supported & tested for inline scripts but not for external ones. Fixes gh-4518 Closes gh-4601
* Build: Make Karma work in ES modules modeMichał Gołębiowski-Owczarek2019-12-161-3/+8
| | | | | | Also, run such a suite in CI to make sure modules are working as expected when used directly. Closes gh-4550
* Build: Auto-convert sources to AMDMichał Gołębiowski-Owczarek2019-12-091-5/+7
| | | | | | | | | | | | | | | jQuery source has been migrated in gh-4541 from AMD to ES modules. To maintain support for consumers of our AMD modules, this commits adds a task transpiling the ES modules sources in `src/` to AMD in `amd/`. A "Load with AMD" checkbox was also restored to the QUnit setup. Note that, contrary to jQuery 3.x, AMD files need to be generated via `grunt amd` or `grunt` as sources are not authored in ECMAScript modules. To achieve a similar no-compile experience during jQuery 4.x testing, use the new "Load as modules" checkbox which works in all supported browsers except for IE & Edge (the legacy, EdgeHTML-based one). Ref gh-4541 Closes gh-4554
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Tests: Fix a comment in testinit.jsMichał Gołębiowski-Owczarek2019-08-191-1/+0
| | | | | | | A copied comment line was accidentally left out above the line defining `QUnit.jQuerySelectorsPos`, making the sentence nonsense. This commit removes that line. Closes gh-4458
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-291-3/+15
| | | | | | | | | | | | | | | | | | 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-8/+32
| | | | | | | 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-8/+5
| | | | | | | Also, update some tests to IE-sniff when deciding whether to skip a test. Fixes gh-4386 Closes gh-4387
* Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJSMichał Gołębiowski-Owczarek2019-04-291-40/+6
| | | | | | | | | | | Also, update support comments format to match format described in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197 with the change from: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-448998379 (open-ended ranges end with `+`). Fixes gh-3950 Fixes gh-4299 Closes gh-4347
* Build: Update test code for compatibility with QUnit 2.x (#4297)abnud12019-02-181-5/+6
| | | | | | | | 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
* Tests: Allow Karma to load unminfied sourceRichard Gibson2018-09-071-14/+28
| | | Closes gh-4128
* Tests: ensure that module assertions run on supported browsersTimmy Willison2018-01-161-0/+10
| | | | | | - Also fixes tests for karma, where the URL for the module is different Ref gh-3871
* Core: deprecate jQuery.isFunctionJason Bedard2018-01-151-2/+2
| | | | Fixes gh-3609
* Tests: Add support for running unit tests via grunt with karmaTimo Tijhof2017-12-181-12/+25
| | | | | | | | | | | | | - 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
* Tests: Revert some testIframe changes to fix dimensions testsRichard Gibson2017-04-291-7/+2
| | | | Ref c0edd8dc18e02999a25768a4946093b015045f80
* Revert "Tests: Revert some testIframe changes to fix dimensions tests"Richard Gibson2017-04-291-2/+7
| | | | This reverts commit c4368a93116e9d1d17587fc2f5421a891957cf45.
* Tests: Revert some testIframe changes to fix dimensions testsRichard Gibson2017-04-291-7/+2
| | | | Ref c0edd8dc18e02999a25768a4946093b015045f80
* Tests: Clean up offset debuggingRichard Gibson2017-04-291-7/+1
| | | | | Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0 Ref c0edd8dc18e02999a25768a4946093b015045f80
* Tests: Adjust by actual scroll position, rather than expectedRichard Gibson2017-04-291-1/+1
| | | | Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0
* Tests: Keep iframes visible in TestSwarmRichard Gibson2017-04-281-2/+13
| | | | Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0
* Tests: Prepend test iframes for even *more* consistencyRichard Gibson2017-04-251-1/+1
| | | | Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0
* Tests: Allow a mock QUnit.test for perfect testIframe fidelityRichard Gibson2017-04-251-2/+5
| | | | Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0 Closes gh-3647
* Tests: Attach test iframes to the body for visibility-dependent codeRichard Gibson2017-04-251-6/+9
| | | | Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0 Closes gh-3645
* Tests: Improve offset test setup and labelsRichard Gibson2017-04-241-0/+1
| | | | | | Hopefully this fixes iOS testing: http://swarm.jquery.org/job/5226 Ref 1d2df772b4d6e5dbf91df6e75f4a1809f7879ab0 Closes gh-3641
* Core: Deprecate jQuery.isArrayManoj Kumar2016-11-301-1/+1
| | | | | Fixes gh-2961 Closes gh-3278
* Core: expose noConflict in AMD modeTimmy Willison2016-08-151-3/+1
| | | | | | | | - For compability reasons, we had already added the global in AMD mode, but without noConflict. This adds back noConflict to AMD (which fixes noConflict mode in the tests). Fixes gh-2930
* Build: ESLint detailsOleg Gaidarenko2016-06-111-29/+28
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Tests: Refactor testIframe() to make it DRYer and more consistentDave Methvin2016-04-111-4/+3
| | | | | Ref gh-3040 Closes gh-3049
* Tests: Make iframe tests wait after checking isReadyDave Methvin2016-04-111-31/+0
| | | | Ref gh-3040
* Tests: do not run IE9 effect tests if inside testswarmOleg Gaidarenko2016-04-041-4/+5
| | | | | | | | That test doesn't work properly in such environment Ref e04e246552c27e872bbf4ae00b55def02b197189 Fixes gh-2888 Closes gh-3034
* Tests: Restrict "p > * > *" selection in selector.js to #qunit-fixtureAlexander Lisianoi2016-03-091-8/+32
| | | | | | | | Add `match` and `QUnit.assert.selectInFixture` functions that mimic `QUnit.assert.t`. Ref gh-2880 Closes gh-2973
* Tests: Keep test iframes around for assertionsRichard Gibson2015-10-171-1/+1
| | | | | | Ref 44f8239d3f9d09d81e2885e9ae7e044277b67341 Ref gh-2644 Ref gh-2390
* Tests:Docs: Fix various typosGary Ye2015-10-121-2/+2
| | | | | | | | | | | | * Changes "baar" to "bar" when used with "foo" in readme and comments of js files * mousenter -> mouseenter Thanks @garysye, @KimTaehee Closes gh-2613 Closes gh-2601
* Event: Move .bind() and .delegate() to deprecatedDave Methvin2015-10-121-0/+1
| | | | | Fixes gh-2288 Closes gh-2624
* Tests: Use QUnit URL parameter parsingRichard Gibson2015-10-081-6/+3
|
* Tests: Add dummy modules when running basic testsRichard Gibson2015-10-081-13/+16
| | | | | | | Without this, other modules don't appear in the QUnit module picker. Ref 855b0c8c288533948b257925a8906f7da3449eed Closes gh-2582
* Tests: Really fix tests in IE 8 this timeMichał Gołębiowski2015-09-081-1/+1
| | | | | | | | | IE 8 doesn't have indexOf on arrays. Also, one toLowerCase() was missing. Oops. This commit is not necessary on master but has been brought here to keep tests similar in both branches. (cherry-picked from 1b48eef4caf7fa3aba0ee1a3473e0d46487d20ea)
* Tests: Don't load non-basic tests when basic module is selectedMichał Gołębiowski2015-09-081-29/+37
| | | | | | | | When loading basic tests don't load any others to not overload Android 2.3. The drawback is that most tests are not selectable in the module dropdown when the basic module is seelcted. Refs 2c7e9c934971500a746d012c529e13ec0b560a83
* Tests: Add simple tests for Android 2.3Michał Gołębiowski2015-09-081-0/+6
| | | | | | Fixes gh-2505 Closes gh-2509 Refs gh-2483