#flush(mock) does not resolve obserable while testing Http reqest

17 messages ยท Page 1 of 1 (latest)

indigo osprey
#

Do u have a working test ?

#

If so, can you share one that works ?

noble nimbus
#

not at the moment, we have only this http request on our project

indigo osprey
#

What is this.transformData?

#

Also I think this is wrong:

  jest.spyOn(TestBed.inject(EventService), 'track').mockResolveValue(of(undefined));
#

That should be mockReturnValue.

#

As now it becomes a Promise<Observable<undefined>>

#

While u want Observable<undefined>

noble nimbus
#

yep it is, my bad, I cannot copy the code, so I typed it in

indigo osprey
#

Hard to help when we arent looking at real code. Ensure it's accuratly representing what u have

noble nimbus
#

unfortunatelly I cannot ๐Ÿ˜„

indigo osprey
#

You can.

#

You just have to double and triple check what u write.

#

What is tools and what is this.transformData ?

noble nimbus
#

tell that to my bosses and client

indigo osprey
noble nimbus
#

give me a sec