我做错了什么?我想测试$ logProvider,但似乎应用程序没有配置注入...
"use strict";
var $log$;
describe("logProvider", () => {
var prov;
beforeEach(angular.mock.module('app',($logProvider)=>{
spyOn($logProvider,'debugEnabled');
prov = $logProvider;
}));
beforeEach(inject((_$log_) => { }));
it("should be defined", () => {
expect(prov.debugEnabled).toHaveBeenCalledWith();
});
});
我的日志提供程序配置。
export function logProvider($logProvider){
'ngInject';
$logProvider.debugEnabled(true);
}
错误:
PhantomJS 1.9.8 (Linux 0.0.0)
Expected spy debugEnabled to have been called with [ ] but it was never called.