File tree 1 file changed +7
-6
lines changed
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';
2
2
import { TestBed } from '@angular/core/testing' ;
3
3
import { of } from 'rxjs' ;
4
4
import { RxStateSetupFn , rxState } from './rx-state' ;
5
+ import { RxState } from './rx-state.service' ;
5
6
6
7
describe ( rxState , ( ) => {
7
8
it ( 'should create rxState' , ( ) => {
@@ -87,13 +88,13 @@ describe(rxState, () => {
87
88
} ) ;
88
89
} ) ;
89
90
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 ( ) ;
94
95
fixture . destroy ( ) ;
95
- expect(spy ).toHaveBeenCalled();
96
- });*/
96
+ expect ( RxState . prototype . ngOnDestroy ) . toHaveBeenCalled ( ) ;
97
+ } ) ;
97
98
} ) ;
98
99
99
100
function setupComponent < State extends object > ( setupFn ?: RxStateSetupFn < State > ) {
You can’t perform that action at this time.
0 commit comments