MCPcopy Index your code
hub / github.com/QwikDev/qwik / createDOM

Function createDOM

packages/qwik/src/testing/library.ts:10–27  ·  view source on GitHub ↗
({ html }: { html?: string } = {})

Source from the content-addressed store, hash-verified

8 * @public
9 */
10export const createDOM = async function ({ html }: { html?: string } = {}) {
11 const qwik = await getQwik();
12 setTestPlatform(qwik.setPlatform);
13 const host = new ElementFixture({ html }).host;
14 return {
15 render: function (jsxElement: JSXOutput) {
16 return qwik.render(host, jsxElement);
17 },
18 screen: host,
19 userEvent: async function (
20 queryOrElement: string | Element | keyof HTMLElementTagNameMap | null,
21 eventNameCamel: string | keyof WindowEventMap,
22 eventPayload: any = {}
23 ) {
24 return trigger(host, queryOrElement, eventNameCamel, eventPayload);
25 },
26 };
27};
28
29const getQwik = async (): Promise<typeof import('@builder.io/qwik')> => {
30 if ((globalThis as any).RUNNER !== false) {

Callers 5

render.unit.tsxFile · 0.90
component.unit.tsxFile · 0.90
sync-qrl.unit.tsxFile · 0.90
render.unit.tsxFile · 0.90
example.spec.tsxFile · 0.90

Calls 4

setTestPlatformFunction · 0.90
triggerFunction · 0.90
getQwikFunction · 0.85
renderMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…