File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import {ErrorObservable} from 'rxjs/observable/ErrorObservable';
99
1010describe ( 'HeroService' , ( ) => {
1111 let heroService ;
12- let newHeroCreated ;
1312
1413 beforeEach ( ( ) => {
1514 TestBed . configureTestingModule ( {
@@ -77,7 +76,6 @@ describe('HeroService', () => {
7776 'name' : 'test' ,
7877 'alterEgo' : 'test'
7978 } ) . subscribe ( ( hero ) => {
80- newHeroCreated = hero ;
8179 expect ( hero . id ) . not . toBeNull ( ) ;
8280 } ) ;
8381 } ) ) ;
@@ -110,8 +108,13 @@ describe('HeroService', () => {
110108 } ) ) ;
111109
112110 it ( 'should delete a hero' , async ( ( ) => {
113- heroService . deleteHeroById ( newHeroCreated . id ) . subscribe ( ( response ) => {
114- expect ( response ) . toEqual ( { } ) ;
111+ heroService . createHero ( {
112+ 'name' : 'test' ,
113+ 'alterEgo' : 'test'
114+ } ) . subscribe ( ( hero ) => {
115+ heroService . deleteHeroById ( hero . id ) . subscribe ( ( response ) => {
116+ expect ( response ) . toEqual ( { } ) ;
117+ } ) ;
115118 } ) ;
116119 } ) ) ;
117120} ) ;
You can’t perform that action at this time.
0 commit comments