Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Feb 25, 2025
1 parent b742038 commit f596448
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client/client-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const win = typeof window !== 'undefined' ? window : ({} as Window);

export const doc = win.document || ({
head: {},
querySelectorAll: () => [] as unknown as NodeListOf<Element>,
querySelectorAll: () => [] as unknown[],
} as unknown as Document);

export const H = ((win as any).HTMLElement || (class {} as any)) as HTMLElement;
Expand Down
5 changes: 3 additions & 2 deletions test/wdio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"build.prerender": "node ../../bin/stencil build --config prerender.stencil.config.ts --prerender --debug && node ./test-prerender/prerender.js && node ./test-prerender/no-script-build.js",
"build.invisible-prehydration": "node ../../bin/stencil build --debug --es5 --config invisible-prehydration.stencil.config.ts",
"build.no-external-runtime": "node ../../bin/stencil build --debug --es5 --config no-external-runtime.stencil.config.ts",
"test": "run-s build wdio",
"wdio": "wdio run ./wdio.conf.ts"
"test": "run-s build wdio end-to-end",
"wdio": "wdio run ./wdio.conf.ts",
"end-to-end": "node ./test-end-to-end-import.mjs"
},
"devDependencies": {
"@stencil/core": "file:../..",
Expand Down
9 changes: 9 additions & 0 deletions test/wdio/test-end-to-end-import.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import assert from 'node:assert';

import { AttributeBasicRoot, defineCustomElement } from './test-components/attribute-basic-root.js';

console.log(`🧪 Validate capability to import Stencil dist-custom-elements output target`);
assert.equal(typeof AttributeBasicRoot, 'function');
assert.equal(typeof defineCustomElement, 'function');
console.log(`✅ Success!`);

0 comments on commit f596448

Please sign in to comment.