Relative Content

Tag Archive for jestjsnestjsfetchjest-fetch-mock

Nestjs jest how to mock fetch url, token, headers

I have a nestjs service method which calls fetch and get a binary as response. I am trying to mock dependencies, first url to fetch will come from appConfig file which referes to env(‘url’).
Second Url I want to mock as it will change depending on environments
Third token will be generated on the fly that I want to mock.
Any suggestions,