aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/deferred.js
Commit message (Collapse)AuthorAgeFilesLines
* Build: improve specificity of eslint config; add ecma versionsTimmy Willison2024-06-061-2/+2
| | | Closes gh-5501
* Build: migrate most grunt tasks off of gruntTimmy Willison2023-09-181-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Deferred: Rename `getStackHook` to `getErrorHook`Michał Gołębiowski-Owczarek2023-03-141-6/+6
| | | | | | | | | | | | | | Rename `jQuery.Deferred.getStackHook` to `jQuery.Deferred.getErrorHook` to indicate passing an error instance is usually a better choice - it works with source maps while a raw stack generally does not. In jQuery `3.7.0`, we'll keep both names, marking the old one as deprecated. In jQuery `4.0.0` we'll just keep the new one. This change implements the `4.0.0` version; PR gh-5212 implements the `3.7.0` one. Fixes gh-5201 Closes gh-5211 Ref gh-5212
* Deferred: Respect source maps in jQuery.Deferred.exceptionHookMichał Gołębiowski-Owczarek2023-02-011-3/+3
| | | | | | | | | | | | | | | | | | So far, `jQuery.Deferred.exceptionHook` used to log error message and stack separately. However, that breaks browser applying source maps against the stack trace - most browsers require logging an error instance. This change makes us do exactly that. One drawback of the change is that in IE 11 previously stack was printed directly and now just the error summary; to get to the actual stack trace, three clicks are required. This seems to be a low price to pay for having source maps work in all the other browsers, though. Safari with the new change requires one click to get to the stack trace which sounds manageable. Fixes gh-3179 Closes gh-5192 Ref https://crbug.com/622227
* Tests: Exclude tests based on compilation flags, not API presenceMichał Gołębiowski-Owczarek2022-06-281-1/+1
| | | | | | | | | | 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
* Build:Tests: Fix custom build tests, verify on Travis Michał Gołębiowski-Owczarek2020-01-071-0/+8
| | | | | | | | | | | This commit fixes unit tests for the following builds: 1. The no-deprecated build: `custom:-deprecated` 2. The current slim build: `custom:-ajax,-effects` 3. The future (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Closes gh-4577
* Core: Remove IE-specific support tests, rely on document.documentModeMichał Gołębiowski-Owczarek2019-05-131-13/+11
| | | | | | | 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-57/+16
| | | | | | | | | | | 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-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
* Tests: Fix Android 4.0 Deferred testsMichał Gołębiowski-Owczarek2018-02-121-1/+3
| | | Closes gh-3967
* Core: deprecate jQuery.typeJason Bedard2018-01-161-1/+1
| | | | | Fixes gh-3605 Close gh-3895
* Core: deprecate jQuery.isFunctionJason Bedard2018-01-151-3/+3
| | | | Fixes gh-3609
* Core: Update isFunction to handle unusual-@@toStringTag inputRichard Gibson2017-04-241-6/+38
| | | | | | Ref gh-3597 Fixes gh-3600 Fixes gh-3596 Closes gh-3617
* Deferred: Stop inventing jQuery.when() resolution valuesRichard Gibson2016-12-161-2/+2
| | | | Fixes gh-3442 Closes gh-3445
* Build: ESLint detailsOleg Gaidarenko2016-06-111-5/+5
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Deferred: Propagate progress correctly from unwrapped promisesMichał Gołębiowski2016-06-091-0/+30
| | | | | | | | | | | Progress parameters are now correctly propagated from a deferred to which another deferred resolved unwrapping it. Thanks to @gibson042 for the report and a clear description of the problem and the needed fix. Fixes gh-3062 Closes gh-3150
* Deferred: Give better stack diagnostics on exceptionsDave Methvin2016-05-111-9/+16
| | | | | | | | Ref gh-2736 The exception stack has the name of the immediately outer function where the exception occurred, which can be very handy for tracing errors. Since we already have the exception object we might as well use it.
* Deferred: Make jQuery.when synchronous when possibleRichard Gibson2016-05-091-6/+40
| | | | | | Closes gh-3102 Fixes gh-3100 Closes gh-3105
* Deferred: Separate the two paths in jQuery.whenRichard Gibson2016-05-021-178/+223
| | | | | | | | Single- and no-argument calls act like Promise.resolve. Multi-argument calls act like Promise.all. Fixes gh-3029 Closes gh-3059
* Deferred: Provide explicit undefined context for jQuery.when raw castsRichard Gibson2016-04-271-1/+4
| | | | | Fixes gh-3082 Closes gh-3084
* Deferred: Remove default callback contextRichard Gibson2016-04-231-26/+42
| | | | | | | Employs strict mode to simplify Deferred callback context handling. Fixes gh-3060 Closes gh-3061
* Docs: Update support comments to follow the new syntaxMichał Gołębiowski2016-03-301-2/+2
| | | | | The changes follow the spec proposed in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
* Tests: Fix Deferred tests in Android 5.0's stock Chrome browser & Yandex.BrowserMichał Gołębiowski2016-01-201-2/+36
| | | | | | | | Some Chrome versions newer than 30 but older than 42 display the "undefined is not a function" error, not mentioning the function name. This has been fixed in Chrome 42. Relax two tests to allow for this divergence in older Chromoiums. This affects our Android 5.0 & Yandex.Browser testing.
* Deferred: Warn on exceptions that are likely programming errorsDave Methvin2016-01-131-0/+59
| | | | | Fixes gh-2736 Closes gh-2737
* Deferred: Remove undocumented progress notifications in $.whenDave Methvin2016-01-131-20/+4
| | | | | Fixes gh-2710 Closes gh-2816
* Deferred: syncronize single and multiple target handling in $.whenTimmy Willison2015-11-131-7/+35
| | | | | | Fixes gh-2546 Fixes gh-2018 Close gh-2707
* Tests: further improvements QUnit 2.0 migrationOleg Gaidarenko2015-09-081-2/+4
| | | | | | | | * 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-215/+215
| | | | Fixes gh-2056
* Tests: partially use new qunit interfaceOleg Gaidarenko2015-08-161-98/+98
| | | | | | | | | | | | 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
* Build: Acknowledge Android 2.3 is not ES5-compatibleMichał Gołębiowski2015-07-201-4/+4
| | | | | | | | | | | Android 2.3 chokes on unquoted reserved words being used as property names which was making Deferred tests not run. Acknowledge the sad fact that Android 2.3 is not ES5-compliant browser and enable the "es3" option in JSHint config. Fixes gh-2478 Closes gh-2481
* Deferred: add .catch handlerTimmy Willison2015-07-061-0/+36
| | | | Fixes gh-2102
* Deferred: Always handle progress callbacks before done/failRichard Gibson2015-04-221-0/+48
| | | | | | Fixes gh-2013 Fixes gh-2010 Closes gh-2210
* Deferred: Backwards-compatible standards interoperabilityRichard Gibson2015-03-201-82/+418
| | | | | Fixes gh-1722 Closes gh-1996
* Deferred: Fix $.when with resolved deferred and progress callbacksNicolas HENRY2014-12-251-0/+22
| | | | | Fixes gh-1894 Closes gh-1915
* No ticket: add assertions for jQuery.when( array ). Close gh-1312.Daniel Herman2013-08-191-2/+4
|
* Update jshintrc to conform to new style guide. Conform to onevar and unused ↵Timmy Willison2013-04-091-16/+12
| | | | in tests. Fixes #13755.
* Propagete context of returned deferred object in Deferred.then(). Fixes #13160nanto_vi2013-01-071-1/+17
|
* Deferred: .resolve(), .reject() and .notify() now set the callback context ↵jaubourg2012-12-071-3/+3
| | | | to the promise instance rather than the deferred instance ; .then() has also been amended. Fixes #11405.
* Fixing style for deferred.js unit tests. Close gh-973.Erick Ruiz de Chavez2012-10-161-79/+81
| | | | Close jquery/2012-dev-summit/#56
* deferred.promise(obj) should work with non-objects. Fixes #12521. Much ↵jaubourg2012-09-131-1/+18
| | | | needed unit tests added!
* Make unit tests friendly to Closure Compiler. Closes gh-845.Chad Killingsworth2012-07-051-5/+6
| | | | | | Conflicts: test/unit/effects.js test/unit/offset.js
* Unit tests are linted and passing.Rick Waldron2012-06-211-10/+14
|
* Preserves context objects when multiple Deferreds are passed to $.when(). ↵jaubourg2012-05-121-6/+20
| | | | Context is an array containing the original contexts in order. When non-observable value is given, associated context is undefined. In case only a single non-observable value is given, context is the global object (thanks so much Function.prototype.apply!). Fixes #11749.
* Fix #11736. Remove deprecated Deferred.isResolved/isRejected.Dave Methvin2012-05-111-3/+1
|
* Makes Deferred implementation truly Promise/A compliant. Unit tests amended. ↵jaubourg2012-04-021-33/+37
| | | | Actually few changes required in jQuery's own source and we gained 8 bytes minified gzipped \o/.
* Have Deferred.always return the object onto which it is currently attached ↵jaubourg2011-11-091-0/+13
| | | | to enable true chainability. Fixes #10723. Unit tests added.
* Fix #10691. Remove all instances of equals() and same(), as these are ↵Mike Sherov2011-11-061-3/+3
| | | | deprecated in QUnit.
* Removes isPending and introduces state as a means to retrieve the ↵jaubourg2011-10-111-4/+6
| | | | Deferred/Promise state. Unit tests amended.
* isProgressing becomes isPending. Unit tests added.jaubourg2011-10-041-1/+4
|
* $.Callbacks, $.Topic and notify/progress on $.Deferred.jaubourg2011-09-191-117/+100
|