I have an object that I am mocking up for unit testing. Essentially in my test file I mock it up as follows:
var mockObject = {
mockMethod1 : function() {return true},
mockMethod2 : function() {return true}
};
beforeEach(module('myModule') , function ($provide) {
$provide.value('realObject',mockObject);
});
The way i understand it is that as I test functionality in my module etc... anywhere that references the "realObject" will use my "mockObject"
My issue is that I have made multiple js files for testing and I do not want to define my "mockObject" in each one of them ... nor do i want to maintain it in any more places than i have too.
Is there a way to move my "mockObjact" to a seperate file that gets included in karma.conf.js that will make the "mockObject" available for injection into any of my test files ..... Im thinking along the lines of how you inject $rootScope