How to write test cases for Subscriber and timeout inside ngOnit method?
问题 I have a class in angular8 application with following ngOnit method ngOnInit(): void { this.setCustomizedValues(); this.sub = PubSub.subscribe('highlightEntity', (subId, entityIdentifier: string) => { document.querySelector(entityIdentifier).classList.add('highlight'); setTimeout(() => { document.querySelector(entityIdentifier).classList.remove('highlight'); }, 2000); }); } I have initialised the following test case describe('aComponent', () => { let httpCallerServiceStub = jasmine