Hey there, Automock's creator here. I've been working with TypeScript for a while, and one thing that consistently
takes up a lot of my time is the process of manually mocking for unit tests when dealing with dependency injection
frameworks.
In addition, test suites often lack a consistent structure, which can make the experience even more frustrating.
It can become monotonous and lead to test suites that are hard to manage 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. This solution aims to streamline the unit testing process by automating the creation of mock
objects for classes, improving testing execution speed, and maintaining a consistent structure within DI frameworks.
By creating Automock, I hope to make unit testing more of a standard and integrated aspect of software development, with
the goal of unified and simplified testing across DI frameworks. It has been added to NestJS' recipe page [1], and its
popularity is growing with nearly 60K monthly downloads on NPM.
Here are some core features of Automock:
- Automated Mock Generation: Uses TypeScript's Reflection API to smartly generate mock objects that match the subject
object being tested.
- Framework Compatibility: Started with NestJS and InversifyJS, and planning to expand to TSryinge, TypeDI, and Ts.ED.
- Integration with Testing Libraries: Works smoothly with Jest and Sinon, fitting into various testing workflows.
- Isolated Test Environment: Each test runs in its own space with automatic mock implementations, keeping the tests
clean and focused.
One of the great features of Automock is its ability to speed up test execution. It achieves this by
creating a virtual DI container that bypasses the conventional framework DI container. As a result, test
execution is faster and there is no need to load the real DI container [2].
I believe that Automock has the potential to spark a movement towards improved testing, enhanced quality, and
increased software reliability :)
I'm here to chat, answer questions, and hear what you think. Looking forward to any feedback or ideas you might have!
In addition, test suites often lack a consistent structure, which can make the experience even more frustrating. It can become monotonous and lead to test suites that are hard to manage 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. This solution aims to streamline the unit testing process by automating the creation of mock objects for classes, improving testing execution speed, and maintaining a consistent structure within DI frameworks.
By creating Automock, I hope to make unit testing more of a standard and integrated aspect of software development, with the goal of unified and simplified testing across DI frameworks. It has been added to NestJS' recipe page [1], and its popularity is growing with nearly 60K monthly downloads on NPM.
Here are some core features of Automock:
- Automated Mock Generation: Uses TypeScript's Reflection API to smartly generate mock objects that match the subject object being tested.
- Framework Compatibility: Started with NestJS and InversifyJS, and planning to expand to TSryinge, TypeDI, and Ts.ED.
- Integration with Testing Libraries: Works smoothly with Jest and Sinon, fitting into various testing workflows.
- Isolated Test Environment: Each test runs in its own space with automatic mock implementations, keeping the tests clean and focused.
One of the great features of Automock is its ability to speed up test execution. It achieves this by creating a virtual DI container that bypasses the conventional framework DI container. As a result, test execution is faster and there is no need to load the real DI container [2].
I believe that Automock has the potential to spark a movement towards improved testing, enhanced quality, and increased software reliability :)
I'm here to chat, answer questions, and hear what you think. Looking forward to any feedback or ideas you might have!
--
* [1] https://docs.nestjs.com/recipes/automock * [2] https://github.com/automock/benchmark#visualizations