Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/205989

Change subject: qunit/testrunner: Also disable console.error in 
suppressWarnings()
......................................................................

qunit/testrunner: Also disable console.error in suppressWarnings()

In addition to mw.log.warn, also disable console.error.

To be used in EventLogging unit tests.

Change-Id: I7b09a75da6c985a9e0cc73591f49b21972efd393
---
M tests/qunit/data/testrunner.js
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/205989/1

diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js
index 3c44b55..056cb68 100644
--- a/tests/qunit/data/testrunner.js
+++ b/tests/qunit/data/testrunner.js
@@ -179,7 +179,7 @@
         * </code>
         */
        QUnit.newMwEnvironment = ( function () {
-               var warn, log, liveConfig, liveMessages,
+               var warn, console, error, log, liveConfig, liveMessages,
                        ajaxRequests = [];
 
                liveConfig = mw.config.values;
@@ -188,6 +188,12 @@
                function suppressWarnings() {
                        warn = mw.log.warn;
                        mw.log.warn = $.noop;
+
+                       console = window.console;
+                       error = console && console.error;
+                       if ( error ) {
+                               console.error = $.noop;
+                       }
                }
 
                function restoreWarnings() {
@@ -195,6 +201,9 @@
                                mw.log.warn = warn;
                                warn = undefined;
                        }
+                       if ( error !== undefined ) {
+                               console.error = error;
+                       }
                }
 
                function freshConfigCopy( custom ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/205989
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b09a75da6c985a9e0cc73591f49b21972efd393
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to