0

我正在使用 Angular 4 并解析数据库,我正在尝试实现测试脚本并使用 ng test 命令运行。

它在 parse.initialize() 处的 app.component.ts 页面中返回初始化错误

错误是

“未捕获的类型错误:无法读取未定义的属性‘初始化’”

我在联系组件中实现了下面的示例测试脚本

contact.component.spec.ts:

it(should have as text 'contact page', async(() => {

expect(comp.text).toEqual('contact page');

}));

和我的app.component.ts:

Parse.initialize("myAppId", "myMasterKey");

Parse.serverURL = 'http://localhost:1337/api/';

Parse.masterKey = appConfig.masterKey;
4

0 回答 0