{"version":"1.0","type":"rich","provider_name":"Acast","provider_url":"https://acast.com","height":250,"width":700,"html":"<iframe src=\"https://embed.acast.com/$/655148df2861630012a1d01b/662f5c9eb3b35a0012120329?\" frameBorder=\"0\" width=\"700\" height=\"250\"></iframe>","title":"Artem Zakharchenko: How to Write Epic Automated Tests, Mock ServiceWorker, Open Source","thumbnail_width":200,"thumbnail_height":200,"thumbnail_url":"https://open-images.acast.com/shows/655148df2861630012a1d01b/1714379412796-1f1b825ab422e4908ca59f9e48190344.jpeg?height=200","description":"<p>Don't forget to share and subscribe. Follow along on 𝕏 at https://x.com/tejaskumar_</p><p><br></p><p>Links</p><p><br></p><p>- Codecrafters (sponsor): https://tej.as/codecrafters</p><p>- THAT Conference (partner): https://www.thatconference.com</p><p>- Artem on 𝕏: https://x.com/kettanaito</p><p>- Epic Web: https://epicweb.dev</p><p>- The Golden Rule of Assertions: https://www.epicweb.dev/the-golden-rule-of-assertions</p><p>- The True Purpose of Testing: https://www.epicweb.dev/the-true-purpose-of-testing</p><p><br></p><p>Takeaways</p><p><br></p><p>- Automated testing is crucial for writing better and more reliable software.</p><p>- Testing helps developers describe the intention behind the code and ensure that the implementation meets that intention.</p><p>- Starting with a minimal functional prototype and then writing tests to verify its behavior is a practical approach to testing.</p><p>- Mocking is a technique that helps establish testing boundaries and allows developers to focus on specific behaviors in their tests. Mocking allows you to model different scenarios and create the desired context for tests.</p><p>- The testing setup phase is crucial and often underappreciated.</p><p>- The golden rule of assertion states that a test should only fail if the intention behind the system is not met.</p><p>- Mock Service Worker (MSW) is an API mocking library that uses the Service Worker API to intercept requests and supports both browser and Node.js environments. Open source sustainability is challenging, but financial support from companies can make it more sustainable.</p><p>- MSW has gained financial support through programs and partnerships, allowing for further development and support for users.</p><p>- Concurrent testing support in MSW allows for better performance and avoids shared state issues.</p><p>- Async local storage is a powerful tool in Node.js that helps solve concurrency issues in testing.</p><p>- Setting limitations and principles for open source projects helps maintain focus and manage the scope.</p><p>- Saying no to contributions is important to maintain the project's vision and scope.</p><p>- Adding tests to projects, even small ones, can provide value and ensure reliability.</p><p>- The future of testing lies in making it more accessible and having a testing strategy in place.</p><p>- Balancing speed and quality in testing requires finding a minimal viable test suite that provides value.</p><p>- Automated testing is crucial for ensuring software works reliably in different circumstances.</p><p>- The future of testing involves making it more accessible and promoting its importance in software development.</p><p><br></p><p>Chapters</p><p><br></p><p>00:00 Artem Zakharchenko</p><p>08:13 The Importance of Automated Testing</p><p>15:37 Artem's Role at Epic Web and Testing Workshops</p><p>27:02 Future Plans for Epic Web and Workshops</p><p>28:45 Understanding Mocking and Mocking Strategies</p><p>31:51 Introduction to Mocking and Modeling Scenarios</p><p>33:43 The Broad Use Case of Mocking</p><p>35:20 Finding the Right Balance in Mocking</p><p>36:40 The Golden Rule of Assertion</p><p>39:19 Creation and Iterative Process of Mock Service Worker (MSW)</p><p>45:10 Adding Support for Node.js in MSW</p><p>52:47 Mocking WebSockets with MSW</p><p>01:04:54 Open Source and Sustainability</p><p>01:05:43 Supporting MSW</p><p>01:07:16 Solving Issues with MSW</p><p>01:08:22 Concurrent Testing Support</p><p>01:10:38 Using Async Local Storage</p><p>01:13:30 Strategies for Open Source Maintainers</p><p>01:14:27 Balancing Work-Life and Open Source</p><p>01:18:50 Saying No to Contributions</p><p>01:26:03 Balancing Speed and Quality in Testing</p><p>01:29:00 Adding Automated Testing to Projects</p><p>01:33:49 The Future of Testing</p>","author_name":"Tejas Kumar"}