【发布时间】:2017-06-18 13:05:26
【问题描述】:
这是我的实际 AzureService
declare var WindowsAzure;
declare var config;
@Injectable()
export class AzureService {
azureUrl;
client: any;
programmes: Programme[];
selectedProgramme: Programme;
orderSummary: Order;
constructor() {
this.client = new WindowsAzure.MobileServiceClient(this.azureUrl);}
}
这是我的仪表板规格
describe('DashboardComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
DashbaordComponent,
StatusComponent
],
providers:[ AzureService]
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(DashbaordComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
我在其中注入 azure 服务的仪表板组件承包商:
constructor(private azureService: AzureService) { }
测试失败,说明我没有定义 WindowAzure,但我想在哪里定义?
这是错误:
【问题讨论】:
标签: angular karma-jasmine