ike18t / ts-mockery

Simple type-safe typescript mocking library.
MIT License
42 stars 2 forks source link

Does still library still actively maintainable for new Angular versions? #56

Open Rebaiahmed opened 1 year ago

ike18t commented 1 year ago

This library is web and test framework agnostic with TypeScript as the only dependency so I would imagine it still works w the latest Angular.

In the past I've used it w Angular w jasmine, react w jest, node servers w jest, plus if you want to use a different testing framework you can write your own adapter.

Rebaiahmed commented 1 year ago

It interferes with ng-mocks? it provides mocking only for services? it can be used for mocking components/modules I mean adapt it for Angular development

ike18t commented 1 year ago

I wrote ts-mockery and ng-mocks as separate libraries because they have separate responsibilities.

ng-mocks is what you will use for mocking angular components, directives, and maybe modules. ts-mockery allows for mocking of typescript objects in a completely type-safe way with adapters for spy support.

In an angular world you would maybe use ts-mockery to create the mock services that are then dependency injected into your angular component/directive for instance. It could also be used to mock inputs and such but there is no set playbook of how the two have to be used together.

Rebaiahmed commented 1 year ago

Okay thanks for the update, I found this package https://github.com/NagRock/ts-mockito which provides same options and features for mocking services and I'm confused which one we should choose for our Angular unit tests

harellevy commented 1 year ago

Hi @Rebaiahmed, Are there any migration guides or schematics to migrate from ts-mocks (jasmine) to ts-mockery (jest)?