【发布时间】:2017-10-06 08:45:09
【问题描述】:
我想为私有变量编写单元测试。但是茉莉花不允许我使用它。有人可以解释一下怎么做吗?
export class TestComponent implements OnInit {
private resolve;
public testPrivate() {
this.resolve(false);
}
}
it(
'should test private variable', () => {
component.testPrivate();
expect(component.resolve).toEqual(false);
});
【问题讨论】:
标签: angular unit-testing jasmine