[英]How to set intellisense for react testing library using typescript
I just downloaded Create-React-App which uses react testing library.我刚刚下载了使用反应测试库的 Create-React-App。 I do not get intellisense when I use it's methods (Example: toBeInTheDocument).
当我使用它的方法时,我没有得到智能感知(例如:toBeInTheDocument)。 How to set intellisense?
如何设置智能感知? Do we have any type definitions for RTL?
我们有 RTL 的类型定义吗?
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
You need to import '@testing-library/jest-dom'
你需要导入
'@testing-library/jest-dom'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.