I’m trying to test correctly my package, and I’ve been playing lately with Jasmine. My first try, due to my experience/background, has been try to implement a poor-man’s dependency injection, supplying the dependencies of a class via it’s constructor. This has become a problem very soon, because it’s affecting the design (among some other problems harder to explain).
If I imagine how the perfect scenario would be like, I would think in something similar to being able to require dependencies in my modules, but get mocked (spy) objects.
Exists any documentation about advanced testing of the packages?. I’ve found some tutorials by GitHub, but they all seem to be pretty basic. Also, I’ve found some tutorials about mocking require, but I have more doubts than new ideas. Any package that it’s a great example?
Thanks a lot for your time