Skip to main content

One post tagged with "automation"

View All Tags

Unit Test Like a Pro: Automock, My Open Source Answer to Mocking Frustration

· 6 min read
Omer Morad
Platform Engineer & Testing Advocate

Originally published on Dev.to.

I've been working with TypeScript for a while, and one thing that always seems to be a time-consuming task is manually creating mocks for unit tests when using dependency injection frameworks.

There is often a lack of consistent structure, which can make the experience even more frustrating. It can get repetitive and result in test suites that are difficult to handle and prone to becoming overly complex.

That's why I created Automock. This project is open-source and seeks to change the way we conduct unit testing in TypeScript DI environments. It automatically creates mock objects for classes, improves testing execution speed, and maintaines a consistent structure within DI frameworks such as NestJS and InversifyJS, as well as popular testing libraries like Jest and Sinon.