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:
@@ -7,12 +7,14 @@ jasmineRequire.HtmlSpecFilter = function(j$) {
|
||||
* @deprecated Use {@link HtmlReporterV2Urls} instead.
|
||||
*/
|
||||
function HtmlSpecFilter(options) {
|
||||
j$.getEnv().deprecated(
|
||||
const env = options?.env ?? j$.getEnv();
|
||||
env.deprecated(
|
||||
'HtmlReporter and HtmlSpecFilter are deprecated. Use HtmlReporterV2 instead.'
|
||||
);
|
||||
|
||||
const filterString =
|
||||
options &&
|
||||
options.filterString &&
|
||||
options.filterString() &&
|
||||
options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
const filterPattern = new RegExp(filterString);
|
||||
|
||||
Reference in New Issue
Block a user