Skip to content

Commit 0c2574b

Browse files
fixup
1 parent a490f6e commit 0c2574b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

web-test-runner.config.mjs

+13
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,21 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
132132
133133
}
134134
</script>
135+
<script>
136+
const _customElementsDefine = window.customElements.define;
137+
window.customElements.define = (name, cl, conf) => {
138+
if (!customElements.get(name)) {
139+
try {
140+
_customElementsDefine.call(window.customElements, name, cl, conf);
141+
} catch (e) {
142+
console.warn(e);
143+
}
144+
}
145+
};
146+
</script>
135147
<script>window.process = { env: ${JSON.stringify(process.env)} }</script>
136148
<script type="module" src="${testFramework}"></script>
149+
137150
<script>
138151
function descendants(parent) {
139152
return (Array.from(parent.childNodes)).concat(

0 commit comments

Comments
 (0)