aboutsummaryrefslogtreecommitdiffstats
path: root/test/jquery.js
Commit message (Collapse)AuthorAgeFilesLines
* Build: improve specificity of eslint config; add ecma versionsTimmy Willison2024-06-061-2/+0
| | | Closes gh-5501
* Tests: migrate testing infrastructure to minimal dependenciesTimmy Willison2024-02-261-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Core: Use named exports in `src/`Michał Gołębiowski-Owczarek2023-09-121-1/+1
| | | | | | | | | The `default` export is treated differently across tooling when transpiled to CommonJS - tools differ on whether `module.exports` represents the full module object or just its default export. Switch `src/` modules to named exports for tooling consistency. Fixes gh-5262 Closes gh-5292
* Build: Drop individual AMD modulesMichał Gołębiowski-Owczarek2023-06-271-18/+0
| | | | | | | | | | 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
* Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)Michał Gołębiowski-Owczarek2020-09-221-2/+2
| | | | | | | | | | | | Drop support for Edge Legacy: the non-Chromium, EdgeHTML-based Microsoft Edge version. Also, restrict some workarounds that were applied unconditionally in all browsers to run only in IE now. This slightly increases the size but reduces the performance burden on modern browsers that don't need the workarounds. Also, clean up some comments & remove some obsolete workarounds. Fixes gh-4568 Closes gh-4792
* Build: Make dev mode work in Karma again, serve source files from diskMichał Gołębiowski-Owczarek2020-01-081-11/+22
| | | | | | | | | | | | | | | | | | PR gh-4550 added support for running ES modules & AMD tests via Karma. This required reading the `esmodules` & `amd` props from both `QUnit.config` & `QUnit.urlParams`. By picking these two properties manually, the `dev` one stopped being respected while ones handled directly by QUnit were fine (like `hidepassed`). Instead of maintaining the full list of options, the code now iterates over QUnit URL config and handles the fallbacks in a more generic way. Apart from that, all jQuery source & test files are now read directly from disk instead of being cached by Karma so that one can run `grunt karma:chrome-debug` & work on a fix without restarting that Karma run after each change. A similar effect could have been achieved by setting `autoWatch` to `true` but then the main Karma page runs tests in an iframe by default when `grunt karma:chrome-debug` is run instead of relying on the current debug flow. Closes gh-4574 Ref gh-4550
* Build: Make Karma work in ES modules modeMichał Gołębiowski-Owczarek2019-12-161-30/+34
| | | | | | 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-2/+21
| | | | | | | | | | | | | | | 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-16/+21
| | | | | | | | | | | | | | | | | | | | | | 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
* Core: Preserve CSP nonce on scripts in DOM manipulationMichał Gołębiowski-Owczarek2019-01-141-1/+1
| | | | Fixes gh-3541 Closes gh-4269
* Tests: Allow Karma to load unminfied sourceRichard Gibson2018-09-071-14/+17
| | | Closes gh-4128
* Tests: Update path calculationJordan Beland2017-08-161-1/+2
| | | | Fixes gh-3756 Closes gh-3757
* Tests: Update the loader so test pages always get jQueryRichard Gibson2017-01-091-33/+34
| | | | | | Pages used for iframe tests will now successfully load jQuery, even when opened directly in the browser. Closes gh-3489
* Build: use hard-coded path to sizzle in selector-sizzleTimmy Willison2016-02-101-4/+1
| | | | Fixes gh-2898
* Build: correct style tests files which could be automatically correctedOleg Gaidarenko2015-09-071-9/+11
|
* Build: Move all external libraries to external directoryScott González2014-06-241-1/+1
| | | | Closes gh-1593
* Manage bower dependencies with grunt-bowercopyTimmy Willison2013-12-061-1/+1
| | | | | | | | | | | | 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.
* Use grunt and bower packages as local dependencies. Close gh-1433.Timmy Willison2013-11-141-1/+1
|
* Ref 71b2ac52: Disallow 2.x bypass of environmental helper methodsRichard Gibson2013-11-121-13/+0
|
* Fix #14492: More correct jQuery.parseJSON. Close gh-1419.Richard Gibson2013-11-121-1/+2
| | | | | | | | (cherry picked from commit 60a6178131afec97b68c9a45bc24459f7b8bd905) Conflicts: src/ajax/parseJSON.js
* Woops, lint grunt fileTimmy Willison2013-09-101-1/+1
|
* Map Sizzle to a path with config to allow users to put Sizzle wherever they wantTimmy Willison2013-09-101-1/+6
|
* Convert testrunner to an AMD module and ensure jQuery is on the page when ↵Timmy Willison2013-09-061-4/+2
| | | | executing the testrunner (another race condition amplified by swarm)
* Pass all tests (and load Sizzle fixture correctly) when loading with AMDTimmy Willison2013-08-291-27/+14
|
* Use window.QUnit to detect the top window when loading with AMDTimmy Willison2013-08-291-1/+3
|
* Fix tests for testswarmTimmy Willison2013-08-191-2/+1
|
* Correct QUnit check, this might fix swarm failuresOleg2013-08-191-2/+2
|
* AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.Timmy Willison2013-08-151-5/+77
|
* Ref #13316: Sync all documents on full vs. minified source. Close gh-1147.Richard Gibson2013-02-071-0/+5