Prevent monkey patching

This doesn't affect globals (describe, it, expect, etc). Those belong to
the user and Jasmine doesn't depend on them.
This commit is contained in:
Steve Gravrock
2026-02-16 11:06:27 -08:00
parent 281c0d1ee8
commit 63ac7da082
23 changed files with 263 additions and 9 deletions

View File

@@ -1396,4 +1396,6 @@ describe('HtmlReporterV2', function() {
});
});
});
isNonMonkeyPatchableClass(jasmineUnderTest.HtmlReporterV2, setup);
});

View File

@@ -63,4 +63,8 @@ describe('HtmlReporterV2Urls', function() {
return qs;
}
});
isNonMonkeyPatchableClass(jasmineUnderTest.HtmlReporterV2Urls, function() {
return new jasmineUnderTest.HtmlReporterV2Urls({});
});
});

View File

@@ -77,4 +77,12 @@ describe('QueryString', function() {
expect(queryString.getParam('baz')).toBeFalsy();
});
});
isNonMonkeyPatchableClass(jasmineUnderTest.QueryString, function() {
return new jasmineUnderTest.QueryString({
getWindowLocation: function() {
return { search: '' };
}
});
});
});