Skip to content

Commit

Permalink
update karma
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Mar 18, 2024
1 parent aae95c4 commit 2bfa5f1
Show file tree
Hide file tree
Showing 6 changed files with 302 additions and 277 deletions.
3 changes: 1 addition & 2 deletions test/karma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"scripts": {
"clean": "rm -rf test-output tmp-compiled-tests",
"start": "node ../../bin/stencil build --dev --watch --serve --es5",
"build.all": "npm run clean && npm run build.sibling && npm run build.globalScripts && npm run build.invisible-prehydration.false && npm run build.app && npm run build.custom-elements && npm run karma.webpack && npm run build.prerender",
"build.all": "npm run clean && npm run build.sibling && npm run build.globalScripts && npm run build.invisible-prehydration.false && npm run build.app && npm run karma.webpack && npm run build.prerender",
"build.app": "npm run compile.test-app && node ../../bin/stencil build --debug --es5",
"compile.test-app": "node ../../node_modules/typescript/lib/tsc -p tsconfig.json",
"build.custom-elements": "webpack-cli --config test-app/custom-elements-output-webpack/webpack.config.js && webpack-cli --config test-app/custom-elements-output-tag-class-different/webpack.config.js && webpack-cli --config test-app/custom-elements-delegates-focus/webpack.config.js",
"build.invisible-prehydration.false": "node ../../bin/stencil build --config test-invisible-prehydration/stencil.invisiblePrehydrationFalse.config.ts --debug",
"build.prerender": "node ../../bin/stencil build --config test-prerender/stencil.config-prerender.ts --prerender --debug && node test-prerender/no-script-build.js",
"build.sibling": "node ../../bin/stencil build --config test-sibling/stencil.config.ts --debug",
Expand Down
101 changes: 18 additions & 83 deletions test/karma/test-app/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,9 @@ export namespace Components {
}
interface CmpLabelWithSlotSibling {
}
interface CustomElementChild {
interface CssVariablesNoEncapsulation {
}
interface CustomElementChildDifferentNameThanClass {
}
interface CustomElementNestedChild {
}
interface CustomElementRoot {
}
interface CustomElementRootDifferentNameThanClass {
}
interface CustomElementsDelegatesFocus {
}
interface CustomElementsNoDelegatesFocus {
interface CssVariablesShadowDom {
}
interface EsmImport {
"propVal": number;
Expand Down Expand Up @@ -296,47 +286,17 @@ declare global {
prototype: HTMLCmpLabelWithSlotSiblingElement;
new (): HTMLCmpLabelWithSlotSiblingElement;
};
interface HTMLCustomElementChildElement extends Components.CustomElementChild, HTMLStencilElement {
}
var HTMLCustomElementChildElement: {
prototype: HTMLCustomElementChildElement;
new (): HTMLCustomElementChildElement;
};
interface HTMLCustomElementChildDifferentNameThanClassElement extends Components.CustomElementChildDifferentNameThanClass, HTMLStencilElement {
}
var HTMLCustomElementChildDifferentNameThanClassElement: {
prototype: HTMLCustomElementChildDifferentNameThanClassElement;
new (): HTMLCustomElementChildDifferentNameThanClassElement;
};
interface HTMLCustomElementNestedChildElement extends Components.CustomElementNestedChild, HTMLStencilElement {
}
var HTMLCustomElementNestedChildElement: {
prototype: HTMLCustomElementNestedChildElement;
new (): HTMLCustomElementNestedChildElement;
};
interface HTMLCustomElementRootElement extends Components.CustomElementRoot, HTMLStencilElement {
}
var HTMLCustomElementRootElement: {
prototype: HTMLCustomElementRootElement;
new (): HTMLCustomElementRootElement;
};
interface HTMLCustomElementRootDifferentNameThanClassElement extends Components.CustomElementRootDifferentNameThanClass, HTMLStencilElement {
}
var HTMLCustomElementRootDifferentNameThanClassElement: {
prototype: HTMLCustomElementRootDifferentNameThanClassElement;
new (): HTMLCustomElementRootDifferentNameThanClassElement;
};
interface HTMLCustomElementsDelegatesFocusElement extends Components.CustomElementsDelegatesFocus, HTMLStencilElement {
interface HTMLCssVariablesNoEncapsulationElement extends Components.CssVariablesNoEncapsulation, HTMLStencilElement {
}
var HTMLCustomElementsDelegatesFocusElement: {
prototype: HTMLCustomElementsDelegatesFocusElement;
new (): HTMLCustomElementsDelegatesFocusElement;
var HTMLCssVariablesNoEncapsulationElement: {
prototype: HTMLCssVariablesNoEncapsulationElement;
new (): HTMLCssVariablesNoEncapsulationElement;
};
interface HTMLCustomElementsNoDelegatesFocusElement extends Components.CustomElementsNoDelegatesFocus, HTMLStencilElement {
interface HTMLCssVariablesShadowDomElement extends Components.CssVariablesShadowDom, HTMLStencilElement {
}
var HTMLCustomElementsNoDelegatesFocusElement: {
prototype: HTMLCustomElementsNoDelegatesFocusElement;
new (): HTMLCustomElementsNoDelegatesFocusElement;
var HTMLCssVariablesShadowDomElement: {
prototype: HTMLCssVariablesShadowDomElement;
new (): HTMLCssVariablesShadowDomElement;
};
interface HTMLEsmImportElementEventMap {
"someEvent": any;
Expand Down Expand Up @@ -924,13 +884,8 @@ declare global {
"child-with-reflection": HTMLChildWithReflectionElement;
"cmp-label": HTMLCmpLabelElement;
"cmp-label-with-slot-sibling": HTMLCmpLabelWithSlotSiblingElement;
"custom-element-child": HTMLCustomElementChildElement;
"custom-element-child-different-name-than-class": HTMLCustomElementChildDifferentNameThanClassElement;
"custom-element-nested-child": HTMLCustomElementNestedChildElement;
"custom-element-root": HTMLCustomElementRootElement;
"custom-element-root-different-name-than-class": HTMLCustomElementRootDifferentNameThanClassElement;
"custom-elements-delegates-focus": HTMLCustomElementsDelegatesFocusElement;
"custom-elements-no-delegates-focus": HTMLCustomElementsNoDelegatesFocusElement;
"css-variables-no-encapsulation": HTMLCssVariablesNoEncapsulationElement;
"css-variables-shadow-dom": HTMLCssVariablesShadowDomElement;
"esm-import": HTMLEsmImportElement;
"external-import-a": HTMLExternalImportAElement;
"external-import-b": HTMLExternalImportBElement;
Expand Down Expand Up @@ -1039,19 +994,9 @@ declare namespace LocalJSX {
}
interface CmpLabelWithSlotSibling {
}
interface CustomElementChild {
}
interface CustomElementChildDifferentNameThanClass {
}
interface CustomElementNestedChild {
}
interface CustomElementRoot {
}
interface CustomElementRootDifferentNameThanClass {
}
interface CustomElementsDelegatesFocus {
interface CssVariablesNoEncapsulation {
}
interface CustomElementsNoDelegatesFocus {
interface CssVariablesShadowDom {
}
interface EsmImport {
"onSomeEvent"?: (event: EsmImportCustomEvent<any>) => void;
Expand Down Expand Up @@ -1283,13 +1228,8 @@ declare namespace LocalJSX {
"child-with-reflection": ChildWithReflection;
"cmp-label": CmpLabel;
"cmp-label-with-slot-sibling": CmpLabelWithSlotSibling;
"custom-element-child": CustomElementChild;
"custom-element-child-different-name-than-class": CustomElementChildDifferentNameThanClass;
"custom-element-nested-child": CustomElementNestedChild;
"custom-element-root": CustomElementRoot;
"custom-element-root-different-name-than-class": CustomElementRootDifferentNameThanClass;
"custom-elements-delegates-focus": CustomElementsDelegatesFocus;
"custom-elements-no-delegates-focus": CustomElementsNoDelegatesFocus;
"css-variables-no-encapsulation": CssVariablesNoEncapsulation;
"css-variables-shadow-dom": CssVariablesShadowDom;
"esm-import": EsmImport;
"external-import-a": ExternalImportA;
"external-import-b": ExternalImportB;
Expand Down Expand Up @@ -1394,13 +1334,8 @@ declare module "@stencil/core" {
"child-with-reflection": LocalJSX.ChildWithReflection & JSXBase.HTMLAttributes<HTMLChildWithReflectionElement>;
"cmp-label": LocalJSX.CmpLabel & JSXBase.HTMLAttributes<HTMLCmpLabelElement>;
"cmp-label-with-slot-sibling": LocalJSX.CmpLabelWithSlotSibling & JSXBase.HTMLAttributes<HTMLCmpLabelWithSlotSiblingElement>;
"custom-element-child": LocalJSX.CustomElementChild & JSXBase.HTMLAttributes<HTMLCustomElementChildElement>;
"custom-element-child-different-name-than-class": LocalJSX.CustomElementChildDifferentNameThanClass & JSXBase.HTMLAttributes<HTMLCustomElementChildDifferentNameThanClassElement>;
"custom-element-nested-child": LocalJSX.CustomElementNestedChild & JSXBase.HTMLAttributes<HTMLCustomElementNestedChildElement>;
"custom-element-root": LocalJSX.CustomElementRoot & JSXBase.HTMLAttributes<HTMLCustomElementRootElement>;
"custom-element-root-different-name-than-class": LocalJSX.CustomElementRootDifferentNameThanClass & JSXBase.HTMLAttributes<HTMLCustomElementRootDifferentNameThanClassElement>;
"custom-elements-delegates-focus": LocalJSX.CustomElementsDelegatesFocus & JSXBase.HTMLAttributes<HTMLCustomElementsDelegatesFocusElement>;
"custom-elements-no-delegates-focus": LocalJSX.CustomElementsNoDelegatesFocus & JSXBase.HTMLAttributes<HTMLCustomElementsNoDelegatesFocusElement>;
"css-variables-no-encapsulation": LocalJSX.CssVariablesNoEncapsulation & JSXBase.HTMLAttributes<HTMLCssVariablesNoEncapsulationElement>;
"css-variables-shadow-dom": LocalJSX.CssVariablesShadowDom & JSXBase.HTMLAttributes<HTMLCssVariablesShadowDomElement>;
"esm-import": LocalJSX.EsmImport & JSXBase.HTMLAttributes<HTMLEsmImportElement>;
"external-import-a": LocalJSX.ExternalImportA & JSXBase.HTMLAttributes<HTMLExternalImportAElement>;
"external-import-b": LocalJSX.ExternalImportB & JSXBase.HTMLAttributes<HTMLExternalImportBElement>;
Expand Down
4 changes: 2 additions & 2 deletions test/wdio/custom-elements-delegates-focus/cmp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { render } from '@wdio/browser-runner/stencil';
describe('custom-elements-delegates-focus', () => {
before(() => {
render({
template:() => (
template: () => (
<>
<custom-elements-delegates-focus></custom-elements-delegates-focus>
<custom-elements-no-delegates-focus></custom-elements-no-delegates-focus>
</>
)
),
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('custom-elements-output-tag-class-different', () => {
<>
<custom-element-root-different-name-than-class></custom-element-root-different-name-than-class>
</>
)
),
});
});

Expand All @@ -18,7 +18,9 @@ describe('custom-elements-output-tag-class-different', () => {
const elm = document.querySelector('custom-element-root-different-name-than-class');
expect(elm.shadowRoot).toBeDefined();

const childElm = elm.shadowRoot.querySelector('custom-element-child-different-name-than-class');
const selector = 'custom-element-child-different-name-than-class';
await browser.waitUntil(() => Boolean(elm.shadowRoot.querySelector(selector)));
const childElm = elm.shadowRoot.querySelector(selector);
expect(childElm.shadowRoot).toBeDefined();
});
});
2 changes: 1 addition & 1 deletion test/wdio/custom-elements-output-webpack/cmp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('custom-elements-output-webpack', () => {
expect(customElements.get('custom-element-nested-child')).toBeDefined();

const elm = document.querySelector('custom-element-root');
await browser.waitUntil(() => Boolean(elm.shadowRoot.querySelector('custom-element-child')))
await browser.waitUntil(() => Boolean(elm.shadowRoot.querySelector('custom-element-child')));
const childElm = elm.shadowRoot.querySelector('custom-element-child');
const childNestedElm = childElm.shadowRoot.querySelector('custom-element-nested-child');

Expand Down
Loading

0 comments on commit 2bfa5f1

Please sign in to comment.