내 검사에서 탈퇴 할 수 없습니다. 누구든지이 문제가 있습니까 ?? (나는 아무 잘못을하고있는 중이 야?)ngOnDestroy()에서 수신 거부 할 수 없습니다. 각도 5
기본 검사 :
describe('ngOnDestroy()',() => {
it('should unsubscribe if isLoggedInSub is defined', async(() => {
comp.ngOnInit();
fixture.detectChanges();
comp.ngOnDestroy();
fixture.detectChanges();
expect(comp.isLoggedInSub).not.toBeDefined();
}));
});
콘솔 오류 :
Uncaught Expected Subscriber({ closed: true, _parent: null, _parents: null, _subscriptions: null, syncErrorValue: null, syncErrorThrown: false, syncErrorThrowable: false, isStopped: true, destination: SafeSubscriber({ closed: false, _parent: null, _parents: null, _subscriptions: null, syncErrorValue: null, syncErrorThrown: false, syncErrorThrowable: false, isStopped: false, destination: Object({ closed: true, next: Function, error: Function, complete: Function }), _parentSubscriber: <circular reference: Object>, _context: <circular reference: Object>, _next: Function, _error: undefined, _complete: undefined }) }) not to be defined.
at Object.testing_3.async
것이다 할까? 'ngOnDestroy' 메소드는 어떻게 생겼을까요? – vincecampanale
'isLoggedInSub : 정액제,'' isLoggedInSub someObservableFunction.subscribe = (() =>을 {})'' ngOnDestroy() {isLoggedInSub.unsubscribe()}' – cuznerdexter