Draft change with details at https://gerrit.wikimedia.org/r/323445/.
Each QUnit test should either return a Promise to QUnit.test (which QUnit will automatically wait for and also report a test failure if the Promise is rejected), or manually use assert.async() where needed.
Examples:
QUnit.test( 'example should pass', function ( assert ) { return something().then( function ( val ) { assert.equals( val, 'expected' ); } ); } ); QUnit.test( 'example should fail', function ( assert ) { var done = assert.async(); something().fail( function ( val ) { assert.equals( val, 'error message' ); } ).always( done ); } );
This is in preparation for jQuery 3.0, where $.Deferred callbacks are processed asynchronously. https://jquery.com/upgrade-guide/3.0/
Failures can be seen at the pending core patch: https://gerrit.wikimedia.org/r/322812/.
- siteselector.tests – https://gerrit.wikimedia.org/r/#/c/344405/
- EntityTermsChanger.tests – https://gerrit.wikimedia.org/r/#/c/323445/ https://gerrit.wikimedia.org/r/#/c/347167/
- SiteLinkSetsChanger.tests – https://gerrit.wikimedia.org/r/#/c/347349/ https://gerrit.wikimedia.org/r/#/c/347349/
- entitytermsforlanguagelistview – https://gerrit.wikimedia.org/r/#/c/346753/
- Others?