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
I have problem with new cypress config from version 10 in my next.js app.
I started use cypress.config.ts for e2e but if I used this I get error on unit tests every time. Property 'toBeVisible' does not exist on type 'Assertion'.
describe('Card',()=>{it('render card',async()=>{consthandleClick=jest.fn();render(<CardhandleClick={handleClick}>Foo</Card>);expect(screen.getByText('Foo')).toBeVisible();// `Property 'toBeVisible' does not exist on type 'Assertion'.`fireEvent.click(screen.getByTestId('card'));expect(handleClick).toHaveBeenCalledTimes(1);// `Property 'toHaveBeenCalledTimes' does not exist on type 'Assertion'.`});});
I have one basic tsconfig.json where exclude cypress and then I have second for cypress in cypress folder.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I have problem with new cypress config from version 10 in my next.js app.
I started use
cypress.config.ts
for e2e but if I used this I get error on unit tests every time.Property 'toBeVisible' does not exist on type 'Assertion'.
cypress.config.ts
error unit test
I have one basic
tsconfig.json
where exclude cypress and then I have second for cypress in cypress folder.cypress/tsconfig.json
And it's weird at the end, because if I change import to require in
cypress.config.ts
, all configurations will start worked.cypress.config.ts
Anyone any advice please 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions