I find that when writing angular unit tests, I often do similar things in every test file, for example. compiling and digesting directives. I would like to bring these functions to a separate library, but I wonder how best to do this.
I looked at angular.mocks and saw that it uses a module template to add angular.mocks to the window, and I load angular-mocks.js through an array of karma files. I have no problem creating my library, but I was wondering if there was any request ("mylib") that I could use in my test, which I did not know about.
source
share