Closed Barbapapazes closed 4 years ago
There is a section on how to test services at https://docs.feathersjs.com/guides/basics/testing.html#testing-services. You do not need to instantiate them yourself, you just pull in the application object and run the test against the already registered and instantiated service.
Comment/Problem
I think it could be nice to show how to test a class of a service. Because testing hook is is just testing function but classes are different.
In fact, to instantiate a class, we need to pass some options like the model, for mongoose adapter, and at the end, we call "super.created" (or any other methods). But this will call a method from adapter common which call the method from the mongoose adapter. It's very difficult to understand and I think that it could be a good think to explain it. Otherwise, I found no resources on internet. 😐