({ html }: { html?: string } = {})
| 8 | * @public |
| 9 | */ |
| 10 | export 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 | |
| 29 | const getQwik = async (): Promise<typeof import('@builder.io/qwik')> => { |
| 30 | if ((globalThis as any).RUNNER !== false) { |
no test coverage detected
searching dependent graphs…