Artem Zakharchenko: How to Write Epic Automated Tests, Mock ServiceWorker, Open Source

ConTejas Code - A podcast by Tejas Kumar - Mondays

Categories:

Don't forget to share and subscribe. Follow along on 𝕏 at https://x.com/tejaskumar_Links- Codecrafters (sponsor): https://tej.as/codecrafters- THAT Conference (partner): https://www.thatconference.com- Artem on 𝕏: https://x.com/kettanaito- Epic Web: https://epicweb.dev- The Golden Rule of Assertions: https://www.epicweb.dev/the-golden-rule-of-assertions- The True Purpose of Testing: https://www.epicweb.dev/the-true-purpose-of-testingTakeaways- Automated testing is crucial for writing better and more reliable software.- Testing helps developers describe the intention behind the code and ensure that the implementation meets that intention.- Starting with a minimal functional prototype and then writing tests to verify its behavior is a practical approach to testing.- 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.- The testing setup phase is crucial and often underappreciated.- The golden rule of assertion states that a test should only fail if the intention behind the system is not met.- 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.- MSW has gained financial support through programs and partnerships, allowing for further development and support for users.- Concurrent testing support in MSW allows for better performance and avoids shared state issues.- Async local storage is a powerful tool in Node.js that helps solve concurrency issues in testing.- Setting limitations and principles for open source projects helps maintain focus and manage the scope.- Saying no to contributions is important to maintain the project's vision and scope.- Adding tests to projects, even small ones, can provide value and ensure reliability.- The future of testing lies in making it more accessible and having a testing strategy in place.- Balancing speed and quality in testing requires finding a minimal viable test suite that provides value.- Automated testing is crucial for ensuring software works reliably in different circumstances.- The future of testing involves making it more accessible and promoting its importance in software development.Chapters00:00 Artem Zakharchenko08:13 The Importance of Automated Testing15:37 Artem's Role at Epic Web and Testing Workshops27:02 Future Plans for Epic Web and Workshops28:45 Understanding Mocking and Mocking Strategies31:51 Introduction to Mocking and Modeling Scenarios33:43 The Broad Use Case of Mocking35:20 Finding the Right Balance in Mocking36:40 The Golden Rule of Assertion39:19 Creation and Iterative Process of Mock Service Worker (MSW)45:10 Adding Support for Node.js in MSW52:47 Mocking WebSockets with MSW01:04:54 Open Source and Sustainability01:05:43 Supporting MSW01:07:16 Solving Issues with MSW01:08:22 Concurrent Testing Support01:10:38 Using Async Local Storage01:13:30 Strategies for Open Source Maintainers01:14:27 Balancing Work-Life and Open Source01:18:50 Saying No to Contributions01:26:03 Balancing Speed and Quality in Testing01:29:00 Adding Automated Testing to Projects01:33:49 The Future of Testing Hosted on Acast. See acast.com/privacy for more information.