{"id":684,"date":"2024-01-25T15:56:42","date_gmt":"2024-01-25T14:56:42","guid":{"rendered":"https:\/\/www.javascripttutorials.net\/?p=684"},"modified":"2024-01-27T22:58:15","modified_gmt":"2024-01-27T21:58:15","slug":"testing-react-native-applications-the-smart-way","status":"publish","type":"post","link":"https:\/\/www.javascripttutorials.net\/testing-react-native-applications-the-smart-way\/","title":{"rendered":"Testing React Native Applications the Smart Way"},"content":{"rendered":"<p>This presentation explores the divisive world of software testing, where React.js developers often find themselves torn between writing no tests and striving for 100% test coverage. Learn how to navigate these polarizing positions and adopt a more nuanced strategy that makes testing React applications efficient and effective.<!--more--><\/p>\n<p>The talk dives into the concept of &#8216;Humble Views&#8217;, where we minimize untestable objects by extracting logic from UI elements into test-friendly parts of the codebase. This approach simplifies <a href=\"https:\/\/www.javascripttutorials.net\/tag\/testing\/\">software testing<\/a> of React applications, focusing on business logic instead of UI complexities. Discover how the Model-View-Presenter (MVP) architecture helps achieve this, with presenters serving as a logical layer for testing and hooks aiding in separating logic from UI components.<\/p>\n<p>Throughout the talk, the presenter will discuss the trade-offs of this approach, the role of End-to-End (E2E) tests, and how to strike the perfect balance between too much and too little testing. Join us as we delve into the art of creating &#8216;Humble Views,&#8217; ensuring that our React Native apps are scalable, maintainable, and effectively tested!<\/p>\n<p><iframe loading=\"lazy\" title=\"The Art of Humble Views: Testing React Native Apps the Smart Way - Mo Khazali, TestJS Summit 2023\" width=\"730\" height=\"411\" src=\"https:\/\/www.youtube.com\/embed\/ZeiQLfJMm0g?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Video producer: <a href=\"https:\/\/www.testjssummit.com\">https:\/\/www.testjssummit.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This presentation explores the divisive world of software testing, where React.js developers often find themselves torn between writing no tests and striving for 100% test coverage. Learn how to navigate these polarizing positions and adopt a more nuanced strategy that makes testing React applications efficient and effective.<\/p>\n","protected":false},"author":1,"featured_media":686,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,46],"class_list":["post-684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-react","tag-testing"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":0,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/media\/686"}],"wp:attachment":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}