我有一个Angular 2组件,我正试图对其进行测试,但我遇到了问题,因为数据是在ngOnInit函数中设置的,所以在单元测试中不能立即使用。user-view.component.ts:import {RouteParams} from 'angular2/testing';
import {provide} from 'angular2/co
这是一个有趣的问题:我正在尝试测试一个使用Ionic BarcodeScanner的服务。为了尝试测试,我有一个基于的回购。我正在通过BarcodeScanner.scan模拟spyOn(..).and.callFake(..)方法it("should be able to set a spy on the scanner and test the component", do