Skip to content
Permalink
Browse files

Merge branch 't/13917'

  • Loading branch information...
mlewand committed Feb 2, 2016
2 parents 29e1080 + 5911ece commit 8761a511b95f43b113a6db29ddcd351f904ebfd1
Showing with 13 additions and 13 deletions.
  1. +13 −13 tests/core/log.js
@@ -4,7 +4,9 @@
( function() {
'use strict';

var error, warn, _log, _error, _warn,
var error,
warn,
_console,
consoleEnabled = !!window.console,
ignore = !consoleEnabled,
errorPrefix = '[CKEDITOR] ',
@@ -49,26 +51,25 @@
},

setUp: function() {
// In ie <= 9 console methods log(), warn() and error() are pseudo-functions that do not have
// In IE <= 9 console methods log(), warn() and error() are pseudo-functions that do not have
// call/apply methods. This leads to situation when spy methods cannot work properly.
// Because of that each function should be wrapped before use.
// The console object should be also stubbed because newer sinon version cannot work on that object in
// IE <= 9 (#13917).
if ( consoleEnabled && CKEDITOR.env.ie && CKEDITOR.env.version <= 9 ) {
_log = console.log;
_error = console.error;
_warn = console.warn;

console.log = wrap( _log, console );
console.error = wrap( _error, console );
console.warn = wrap( _warn, console );
_console = window.console;
window.console = {
log: wrap( _console.log, _console ),
warn: wrap( _console[ warn ], _console ),
error: wrap( _console[ error ], _console )
};
}
},

tearDown: function() {
// Cleaning wrapping made in setUp function for ie <= 9.
if ( consoleEnabled && CKEDITOR.env.ie && CKEDITOR.env.version <= 9 ) {
console.log = _log;
console.error = _error;
console.warn = _warn;
window.console = _console;
}
},

@@ -77,7 +78,6 @@
assert.isFunction( CKEDITOR.warn, 'CKEDTIOR.warn function should be defined.' );
},


'no log event and output after CKEDITOR.warn() when verbosity = 0': function() {
var warnStub = sinon.stub( console, warn ),
logEventSpy = sinon.spy();

0 comments on commit 8761a51

Please sign in to comment.
You can’t perform that action at this time.