本文整理匯總了TypeScript中testing/doc-viewer-utils.TestDocViewerComponent.ngOnDestroy方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TestDocViewerComponent.ngOnDestroy方法的具體用法?TypeScript TestDocViewerComponent.ngOnDestroy怎麽用?TypeScript TestDocViewerComponent.ngOnDestroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類testing/doc-viewer-utils.TestDocViewerComponent
的用法示例。
在下文中一共展示了TestDocViewerComponent.ngOnDestroy方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should stop responding to document changes', () => {
const renderSpy = spyOn(docViewer, 'render').and.returnValue([undefined]);
expect(renderSpy).not.toHaveBeenCalled();
docViewer.doc = {contents: 'Some content', id: 'some-id'};
expect(renderSpy).toHaveBeenCalledTimes(1);
docViewer.ngOnDestroy();
docViewer.doc = {contents: 'Other content', id: 'other-id'};
expect(renderSpy).toHaveBeenCalledTimes(1);
docViewer.doc = {contents: 'More content', id: 'more-id'};
expect(renderSpy).toHaveBeenCalledTimes(1);
});
示例2: it
it('should destroy the active embedded component instances', () => {
const destroyEmbeddedComponentsSpy = spyOn(docViewer, 'destroyEmbeddedComponents');
docViewer.ngOnDestroy();
expect(destroyEmbeddedComponentsSpy).toHaveBeenCalledTimes(1);
});