摘要: 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 阅读(1166) 评论(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 阅读(405) 评论(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 阅读(727) 评论(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 阅读(638) 评论(0) 推荐(0)