Skip to content

Commit

Permalink
Add test that fails due to problematic patching
Browse files Browse the repository at this point in the history
  • Loading branch information
greenberga committed Oct 30, 2024
1 parent c398cce commit 875c9c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdktest/test/safe_patching/body.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script defer>
ResizeObserver_toString = ResizeObserver.toString();
</script>
<script defer src="{{ .SiteJSPath }}"></script>
<script defer src="main.tmpl.ts"></script>
14 changes: 14 additions & 0 deletions sdktest/test/safe_patching/main.tmpl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*!
* Copyright (c) Friendly Captcha GmbH 2023.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { sdktest } from "../../sdktestlib/sdk.js";

// This gets set in a <script> tag inlined in the HTML file.
declare var ResizeObserver_toString: string;

sdktest.test({ name: "loading the SDK doesn't break the `toString()` method for native browser objects" }, t => {
t.assert.equal(ResizeObserver_toString, ResizeObserver.toString());
});

0 comments on commit 875c9c8

Please sign in to comment.