Debian Codegraph @

packages/lit-html/src/test/polyfill-support/lit-html-noPatch_test.html

raw symbols SCIP
1 <html>
2 <head>
3 <link rel="stylesheet" href="../../../../../node_modules/mocha/mocha.css" />
4 <meta name="manual-polyfills" />
5 <script>
6 // Simulate no Shadow DOM.
7 Object.defineProperty(Element.prototype, 'attachShadow', {
8 value: undefined,
9 configurable: true,
10 enumerable: true,
11 writable: true
12 });
13
14 window.ShadyDOM = {
15 force: true,
16 noPatch: true,
17 };
18 window.customElements = window.customElements || {};
19 window.customElements.forcePolyfill = true;
20 </script>
21 <script src="../../../../../node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_js.js"></script>
22 <script src="../../../../../node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js"></script>
23 <script src="../../../../../node_modules/@webcomponents/template/template.js"></script>
24 <script src="../../../../../node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js"></script>
25 <script src="../../../../../node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js"></script>
26 </head>
27
28 <body>
29 <script type="module">
30 // node resolution doesn't seem to be working here.
31 import {
32 mocha,
33 sessionFinished,
34 sessionFailed,
35 } from '../../../../../node_modules/@web/test-runner-mocha/dist/standalone.js';
36 // import { mocha, sessionFinished, sessionFailed } from '@web/test-runner-mocha';
37
38 (async () => {
39 try {
40 // setup mocha
41 mocha.setup({ui: 'tdd', timeout: 60000});
42
43 // Note, only test `noPatch` if it's explicitly enabled. This is set
44 // on the `litHtmlPolyfillSupport` object for this purpose.
45 await import('lit-html/polyfill-support.js');
46 if (
47 // Note, since this file is not built, it doesn't support DEV_MODE
48 // so manually check both globals
49 window['litHtmlPolyfillSupport']?.noPatchSupported ||
50 window['litHtmlPolyfillSupportDevMode']?.noPatchSupported) {
51 console.log('Testing `ShadyDOM.noPatch`');
52 await import('./lit-html_html-test.js');
53 }
54
55 // run the tests, and notify the test runner after finishing
56 mocha.run(() => {
57 sessionFinished();
58 });
59 } catch (error) {
60 console.error(error);
61 // notify the test runner about errors
62 sessionFailed(error);
63 }
64 })();
65 </script>
66 <div id="mocha"></div>
67 </body>
68 </html>