如何将Typeings.d添加到角度单元测试

时间:2018-06-19 14:39:36

标签: angular unit-testing webpack karma-jasmine

我正在使用Karma测试包含用于在此处初始化地图的代码的组件

this.platform = new H.service.Platform({
    'app_id': this.configurationService.app_id,
    'app_code': this.configurationService.app_code
});

H是在types.d.ts中声明的变量:

declare var H: any;

如何将打字文件添加到.spec.ts文件?或者如何将H作为全局变量添加到业力测试?到目前为止,我遇到了一个错误:

ReferenceError: Can't find variable: H in `http://localhost:9876/_karma_webpack_/main.bundle.js (line 15130)`

0 个答案:

没有答案