refactored to use jasmine-intercept npm devDependency