使用$ provide.factory在angular中注入模拟模块

时间:2016-04-12 19:46:40

标签: angularjs mocking karma-runner

我正在尝试模拟名为// get the index of the pixel (4 components times the x position plus the y position times the row width) NSInteger pixelIndex = 4*(pixelPosition.x+(pixelPosition.y*width)); // set the pixel components to the color components data[pixelIndex] = color255Components[0]; // r data[pixelIndex+1] = color255Components[1]; // g data[pixelIndex+2] = color255Components[2]; // b data[pixelIndex+3] = color255Components[3]; // a

的服务的子依赖项
$localStorage

我收到错误'$ localStorage is undefined'。我怎么想与间谍一起使用这个模拟的依赖?

0 个答案:

没有答案