Closed
Description
@testing-library/jest-dom
version: 4.2.4node
version: 10.16.0npm
(oryarn
) version: yarn v1.19.1
Relevant code or config:
// menu.test.tsx
expect(getByText('Option 5')).toBeVisible()
// scripts/expect.ts
import '@testing-library/jest-dom/extend-expect'
// jest.config.ts
setupFilesAfterEnv: ['<rootDir>/scripts/expect.ts']
What you did:
I configure the @testing-library/jest-dom/extend-expect following README.md Usage - 1
What happened:
The typescript definition doesn't work:
类型“JestMatchersShape<Matchers<void, HTMLElement>, Matchers<Promise<void>, HTMLElement>>”上不存在属性“toBeVisible”。ts(2339)
In English, the error means JestMatchersShape<Matchers<void, HTMLElement>, Matchers<Promise<void>, HTMLElement>> doesn't has toBeVisible / toBeInDocument attributes
Related issue:
It seems pointed out before, but the solution doesn't work
Metadata
Metadata
Assignees
Labels
No labels