File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Component } from '@angular/core';
22import { TestBed } from '@angular/core/testing' ;
33import { of } from 'rxjs' ;
44import { RxStateSetupFn , rxState } from './rx-state' ;
5+ import { RxState } from './rx-state.service' ;
56
67describe ( rxState , ( ) => {
78 it ( 'should create rxState' , ( ) => {
@@ -87,13 +88,13 @@ describe(rxState, () => {
8788 } ) ;
8889 } ) ;
8990
90- /* it('should call ngOnDestroy', () => {
91- const { fixture, component } = setupComponent ();
92- const spy = jest.spyOn(component.state, 'ngOnDestroy' );
93- expect(spy ).not.toHaveBeenCalled();
91+ it ( 'should call ngOnDestroy' , ( ) => {
92+ RxState . prototype . ngOnDestroy = jest . fn ( ) ;
93+ const { fixture } = setupComponent ( ) ;
94+ expect ( RxState . prototype . ngOnDestroy ) . not . toHaveBeenCalled ( ) ;
9495 fixture . destroy ( ) ;
95- expect(spy ).toHaveBeenCalled();
96- });*/
96+ expect ( RxState . prototype . ngOnDestroy ) . toHaveBeenCalled ( ) ;
97+ } ) ;
9798} ) ;
9899
99100function setupComponent < State extends object > ( setupFn ?: RxStateSetupFn < State > ) {
You can’t perform that action at this time.
0 commit comments