Sveriges mest populära poddar

ConTejas Code

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

97 min • 29 april 2024

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-testing


Takeaways


- 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.


Chapters


00:00 Artem Zakharchenko

08:13 The Importance of Automated Testing

15:37 Artem's Role at Epic Web and Testing Workshops

27:02 Future Plans for Epic Web and Workshops

28:45 Understanding Mocking and Mocking Strategies

31:51 Introduction to Mocking and Modeling Scenarios

33:43 The Broad Use Case of Mocking

35:20 Finding the Right Balance in Mocking

36:40 The Golden Rule of Assertion

39:19 Creation and Iterative Process of Mock Service Worker (MSW)

45:10 Adding Support for Node.js in MSW

52:47 Mocking WebSockets with MSW

01:04:54 Open Source and Sustainability

01:05:43 Supporting MSW

01:07:16 Solving Issues with MSW

01:08:22 Concurrent Testing Support

01:10:38 Using Async Local Storage

01:13:30 Strategies for Open Source Maintainers

01:14:27 Balancing Work-Life and Open Source

01:18:50 Saying No to Contributions

01:26:03 Balancing Speed and Quality in Testing

01:29:00 Adding Automated Testing to Projects

01:33:49 The Future of Testing


Hosted on Acast. See acast.com/privacy for more information.

Kategorier
Förekommer på
00:00 -00:00