-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
feature-componentsopen-to-a-pull-requestThe feature request looks good, we are open to reviewing a PRThe feature request looks good, we are open to reviewing a PR
Description
Page(s)
https://playwright.dev/docs/next/test-components#hooks
// playwright/index.ts
import { beforeMount, afterMount } from '@playwright/experimental-ct-svelte/hooks';
export type HooksConfig = {
context?: string;
}
beforeMount<HooksConfig>(async ({ hooksConfig, App }) => {
return new App({
context: new Map([
['context-key', hooksConfig?.context]
]),
});
});
// context.test.ts
test('context', async ({ mount }) => {
const component = await mount<HooksConfig>(Context, {
hooksConfig: {
context: 'context-value',
}
});
await expect(component).toContainText('context-value');
});
Description
The hooks example for Svelte is missing
Metadata
Metadata
Assignees
Labels
feature-componentsopen-to-a-pull-requestThe feature request looks good, we are open to reviewing a PRThe feature request looks good, we are open to reviewing a PR