Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/206034
Change subject: test: Suppress expected error when running tests ...................................................................... test: Suppress expected error when running tests In the console these errors (while not fatal) are confusing and interrupt the progress dots in the command-line reporter for karma-qunit. > ................ > ERROR: '[earthquake] Url exceeds maximum length' > . > ERROR: '[earthquake] Url exceeds maximum length' > .................................................. Change-Id: Ia53442010cef24c9e345ce2b7f082b2d1a42d1f7 --- M tests/ext.eventLogging.tests.js 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/34/206034/1 diff --git a/tests/ext.eventLogging.tests.js b/tests/ext.eventLogging.tests.js index b0279d9..6ce312a 100644 --- a/tests/ext.eventLogging.tests.js +++ b/tests/ext.eventLogging.tests.js @@ -127,20 +127,30 @@ } }, function ( name, params ) { QUnit.test( name, 1, function ( assert ) { - var url = new Array( params.size + 1 ).join( 'x' ), - result = mw.eventLog.checkUrlSize( 'earthquake', url ); + var url, result; + url = new Array( params.size + 1 ).join( 'x' ); + + this.suppressWarnings(); + result = mw.eventLog.checkUrlSize( 'earthquake', url ); + this.restoreWarnings(); + assert.deepEqual( result, params.expected, name ); } ); } ); QUnit.asyncTest( 'logTooLongEvent', 1, function ( assert ) { - var event = { + var promise, event; + event = { epicenter: 'Valdivia', magnitude: 9.5, article: new Array( mw.eventLog.maxUrlSize + 1).join( 'x' ) }; - mw.eventLog.logEvent( 'earthquake', event ).always( function ( e, error ) { + this.suppressWarnings(); + promise = mw.eventLog.logEvent( 'earthquake', event ); + this.restoreWarnings(); + + promise.always( function ( e, error ) { QUnit.start(); assert.deepEqual( error, 'Url exceeds maximum length', 'logEvent promise resolves with error' ); -- To view, visit https://gerrit.wikimedia.org/r/206034 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia53442010cef24c9e345ce2b7f082b2d1a42d1f7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits