上一页 1 ··· 198 199 200 201 202 203 204 205 206 ··· 494 下一页
摘要: We have a bit of repetition in our rerender calls here and it would be nice if we could avoid that. Let’s use the wrapper option for React Testing Lib 阅读全文
posted @ 2020-05-01 20:28 Zhentiw 阅读(179) 评论(0) 推荐(0)
摘要: Our error boundary has some other use cases that it supports and we should try to make sure our tests cover all those use cases, so let’s add a test t 阅读全文
posted @ 2020-05-01 20:24 Zhentiw 阅读(1168) 评论(0) 推荐(0)
摘要: When testing an error boundary, your console will be filled with console.error calls from React. Those can be a real distraction from the rest of the 阅读全文
posted @ 2020-05-01 20:10 Zhentiw 阅读(409) 评论(0) 推荐(0)
摘要: Error boundary: import React from 'react' import { reportError } from './components/extra/api' export default class ErrorBoundary extends React.Compon 阅读全文
posted @ 2020-05-01 20:07 Zhentiw 阅读(730) 评论(0) 推荐(0)
摘要: There are some situations where you want to focus your tests on a particular component and not any of its children. There are other situations where y 阅读全文
posted @ 2020-05-01 00:36 Zhentiw 阅读(639) 评论(0) 推荐(0)
摘要: If you have a component that makes HTTP requests, you’ll probably want to mock those out for UI unit and integration tests. Let’s see how to use jest’ 阅读全文
posted @ 2020-04-30 19:24 Zhentiw 阅读(308) 评论(0) 推荐(0)
摘要: While not all of accessibility testing of a web application can be automated, much of it can be and quite easily using axe-core and jest-axe. Let’s se 阅读全文
posted @ 2020-04-30 19:09 Zhentiw 阅读(250) 评论(0) 推荐(0)
摘要: You can use 'rerender' for a component when its props changed. Then if you wnat to check the alert message has gone when we rerender, you need to use 阅读全文
posted @ 2020-04-30 18:57 Zhentiw 阅读(203) 评论(0) 推荐(0)
摘要: The User Event module is part of the Testing Library family of tools and lets you fire events on DOM nodes that more closely resemble the way your use 阅读全文
posted @ 2020-04-30 18:45 Zhentiw 阅读(155) 评论(0) 推荐(0)
摘要: The fireEvent utility in React Testing Library supports all the events that you regularly use in the web (change, click, etc.). Let’s see how we can t 阅读全文
posted @ 2020-04-30 18:00 Zhentiw 阅读(407) 评论(1) 推荐(0)
上一页 1 ··· 198 199 200 201 202 203 204 205 206 ··· 494 下一页