Detect monkey patching and emit a deprecation warning.
This isn't comprehensive but it should be broad enough to ensure that most people who would be affected by blocking monkey patching see a warning. Covers the jasmine namespace as well as classes that are monkey patched by zone.js. Replacing globals (describe/it/etc) doesn't trigger a warning because they belong to the user and are expected to be replaced.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
getJasmineRequireObj().Clock = function() {
|
||||
getJasmineRequireObj().Clock = function(j$) {
|
||||
'use strict';
|
||||
|
||||
/* global process */
|
||||
@@ -191,6 +191,9 @@ callbacks to execute _before_ running the next one.
|
||||
clearTimeout[IsMockClockTimingFn] = true;
|
||||
setInterval[IsMockClockTimingFn] = true;
|
||||
clearInterval[IsMockClockTimingFn] = true;
|
||||
|
||||
j$.private.deprecateMonkeyPatching(this);
|
||||
|
||||
return this;
|
||||
|
||||
// Advances the Clock's time until the mode changes.
|
||||
|
||||
Reference in New Issue
Block a user