上一页 1 ··· 201 202 203 204 205 206 207 208 209 ··· 498 下一页
摘要: In package.json file: "prepare": "npm run build", "postpublish": "git push --tags", "prepare": make sure we don't forget to run build before publish t 阅读全文
posted @ 2020-05-04 18:54 Zhentiw 阅读(176) 评论(0) 推荐(0)
摘要: It's always important to test your code, especially if you're open-sourcing it for others to use. In this video, we'll learn how to use react-hooks-te 阅读全文
posted @ 2020-05-04 18:47 Zhentiw 阅读(217) 评论(0) 推荐(0)
摘要: When you use a React Portal, much of your component can be rendered outside the main DOM tree. Let’s see how we can use utilities provided by React Te 阅读全文
posted @ 2020-05-04 02:10 Zhentiw 阅读(705) 评论(0) 推荐(0)
摘要: You can get a huge amount of confidence and coverage from integration tests that test an entire page, or even your entire app. Let’s write a test that 阅读全文
posted @ 2020-05-04 01:58 Zhentiw 阅读(332) 评论(0) 推荐(0)
摘要: Sometimes your react component may need to do some cleanup work in the return value from useEffect or useLayoutEffect, or the componentWillUnmount lif 阅读全文
posted @ 2020-05-04 01:36 Zhentiw 阅读(374) 评论(0) 推荐(0)
摘要: That setup function is pretty handy. Seems like a good opportunity for an abstraction. Well, we already have one! It’s called React Hooks Testing Libr 阅读全文
posted @ 2020-05-04 01:00 Zhentiw 阅读(300) 评论(0) 推荐(0)
摘要: It’s very common for our components to use state from the redux store (or to be refactored to use it eventually). Having to change our tests every tim 阅读全文
posted @ 2020-05-04 00:42 Zhentiw 阅读(342) 评论(0) 推荐(0)
摘要: We’ve got a custom useCounter hook here and we want to make sure the increment and decrement functions it returns will update the count state that it 阅读全文
posted @ 2020-05-03 21:27 Zhentiw 阅读(313) 评论(0) 推荐(0)
摘要: Mocking the <Redirect /> component in react-router works, but it’s imperfect because we don’t know for sure that the user will be redirected properly. 阅读全文
posted @ 2020-05-03 00:32 Zhentiw 阅读(991) 评论(0) 推荐(0)
摘要: We have the happy path covered for our post editor component, but what happens if there’s an error in saving the user’s information? We should probabl 阅读全文
posted @ 2020-05-02 21:48 Zhentiw 阅读(231) 评论(0) 推荐(0)
上一页 1 ··· 201 202 203 204 205 206 207 208 209 ··· 498 下一页