Skip to content

Commit 43818d5

Browse files
committed
test(wtr): enable custom element registry tests
1 parent d9eda1d commit 43818d5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/@lwc/integration-not-karma/configs/integration.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ export default {
99
// FIXME: These tests are just symlinks to integration-karma for now so the git diff smaller
1010
'test/**/*.spec.js',
1111

12-
// Hacky nonsense highly tailored to Karma
13-
'!test/custom-elements-registry/index.spec.js',
14-
1512
// Logging mismatches
1613
'!test/component/LightningElement.addEventListener/index.spec.js',
1714

packages/@lwc/integration-not-karma/test/custom-elements-registry/index.spec.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ async function getEngineCode() {
1818
? ''
1919
: await getModuleCode('synthetic-shadow');
2020

21-
return `
21+
return `(() => {
2222
globalThis.process = { env: { NODE_ENV: "production" } };
2323
globalThis.LWC = globalThis.exports = {};
2424
globalThis.lwcRuntimeFlags = ${JSON.stringify(lwcRuntimeFlags)};
2525
${syntheticShadow};
2626
${engineDom};
27-
`;
27+
})();`;
2828
}
2929

3030
/**
@@ -157,7 +157,9 @@ describe('custom elements registry', () => {
157157

158158
it(`creates elements in first engine - ${description}`, () => {
159159
injectEngine();
160-
callInIframe(() => (window.oldLWC = window.LWC));
160+
callInIframe(() => {
161+
globalThis.oldLWC = globalThis.LWC;
162+
});
161163
injectEngine();
162164
callInIframe(injectableCreateLWC, { customElement, globalLWC: 'oldLWC' });
163165

0 commit comments

Comments
 (0)