You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ./playwright/index.tsximport{beforeMount}from'@playwright/experimental-ct-solid/hooks';// Override HooksConfig so there is no need to specify it as a `mount<HooksConfig>` genericdeclare module '@playwright/experimental-ct-solid/hooks'{interfaceRegisterHooksConfig{route: string;}}beforeMount(async({ hooksConfig })=>{hooksConfig.DOES_NOT_EXSISTS;// throws an error without specifying the generic});
// App.test.tsximport{expect,test}from"@playwright/experimental-ct-solid";import{App}from"./app";test('type check',async({ mount })=>{constcomponent=awaitmount(<App/>, {
hooksConfig: {route: ''}// is typesafe without specifying the `mount<HooksConfig>` generic});awaitexpect(component.getByText('label')).toBeVisible();});
I have hit another issue. HooksConfig is defined to extends JsonObject in the signature of mount which prevents using it with other more restricted types:
The idea comes from @tannerlinsley: https://youtu.be/DXbfDKoMzWY?t=1467.
related: #18616
The text was updated successfully, but these errors were encountered: