In my project, I have a namespace that exports some functions that use Axios, in the same file I add an interceptor to axios instance like that :
axios.interceptors.response.use(
(res) => res,
(error) => {
if (
error.response &&
(error.response.status?.toString() === "400" ||
error.response.status?.toString() === "403" ||
error.response.status?.toString() === "404")
) {
return Promise.reject(
Error(JSON.stringify(error.response.data?.status?.errors[0]))
);
} else if (error.response) {
return Promise.reject(
Error(
`server responsed with the following code: ${error.response?.status} and the following message: ${error.response?.statusText}`
)
);
} else if (error.request) {
return Promise.reject(
Error(
"The request was made but no response was received, check your network connection"
)
);
} else Promise.reject(error);
}
);
I want to test that this interceptor works as expected, I search the forms here and googled a lot but all the answers are basically mocking the interceptor not testing it.
I have tried:
- mocking the response of an axios post request and checking the AxiosPromise that gets returned but it only contained the result I mocked. it seems that it ignores the interceptor when I mock using
mockResolvedValue
. - I have tried adding an interceptor to the mocked axios instance but that did not work too.
Thanks
motilium pills
daily cialis generic
order baclofen online
buy flomax
tadalafil coupon discount
price of cialis
cheap cialis 100mg
where can i buy cialis online
buy tadalafil 20mg uk
cheap viagra from mexico
cialis brand coupon
where to order cialis online
ivermectin cream 5%
cialis tablets canada
generic albuterol no prescription
ivermectin 2
celebrex 400 mg daily
pfizer lipitor
yasmin pill online india
buy voltaren gel in canada
reputable indian pharmacies
viagra cheap prescription
buy tadalafil online no prescription
viagra generic 50 mg
discount cialis online canada
canada prescription viagra
buy stromectol uk
buy discount viagra online
lopressor 20mg
allopurinol medication
tadalafil 2.5 mg
can i buy ventolin over the counter uk
albendazole for sale online
ventolin salbutamol
proscar without prescription
zanaflex
[url=http://sumycintetracycline.quest/]sumycin 500 mg price in india[/url]
prazosin anxiety
stromectol 3 mg
arimidex buy
avodart prescription uk
generic cialis pills
abilify 2mg pill
buspar australia
10mg cialis cost
vardenafil 10mg tablets
how much is generic sildenafil
modafinil mexico
1200 mg modafinil
prednisone 20 mg buy online
cheap generic vardenafil
stromectol oral
buy modafinil online prescription
buy clomid online paypal
buy viagra online europe
can you buy cialis otc
purchase antabuse online
buy lasix tablets india
allopurinol 300 mg daily
buy amoxicillin 500mg online
singulair tabs 10mg
amitriptyline buy online
where to buy cialis without prescription
generic viagra for sale in usa
canada viagra cost
tizanidine 4 mg price
4 motrin pills
zanaflex for sale
tretinoin cream buy australia
4mg zanaflex
azithromycin for sale online
order pharmacy online egypt
generic cialis canada pharmacy
reputable onlinecompanies that sell cialis
buy cialis online canada
avodart capsules
generic propecia india
tadacip online uk
glucophage 500mg
buy motilium online australia
ivermectin 1 topical cream
tetracycline 1
how much is gabapentin 300 mg
citalopram 20mg tab
albuterol for nebulizer
suprax online uk
albuterol tabs
stromectol where to buy
stromectol otc
xenical diet pills
robaxin 750 coupon
stromectol otc
how much is generic flomax
over the counter diflucan cream
stromectol xr
where can i buy erythromycin
hydrochlorothiazide 200 mg
buy provigil online europe
hydrochlorothiazide capsules 12.5 mg
benicar 5 mg tablets
clonidine over the counter uk
tadacip pills 20 mg
sildalis online
erythromycin 250 price in india
lexapro in india
doxycycline acne
buy levitra online without prescription
cost of stromectol
buy plaquenil online uk
trazodone 250 mg
yasmin 21 price
zovirax cold sore
buy tadalafil generic
augmentin 875 pill
buy brand name viagra
how much is cialis 5mg
cialis 2.5 mg canada
drug avodart
online pharmacy uk
rx amoxicillin
cialis without a doctor
stromectol 3 mg
generic atenolol 25 mg
prednisone 477
buy ventolin australia
albenza online pharmacy
[url=https://ivermectinlx.quest/]stromectol for humans[/url]
buy modafinil mexico
india ivermectin
cephalexin brand name india
stromectol online pharmacy
propecia buy india
generic viagra paypal canada
albendazole price in us
ivermectin pills
buy levitra online no prescription
celebrex 100mg mexico
diflucan online pharmacy
cephalexin tablets
erectafil 40
zovirax suspension
order sildenafil from india
buy generic propecia
acyclovir 800mg
amitriptyline hcl 25 mg tab
buy flagyl no rx
allopurinol australia
cafergot medicine
daily cialis price
digoxin 125 mcg tablets
sildenafil cost in india
buy 5mg tadalafil
dexona 4mg tablet online
sildenafil pharmacy nz
prednisolone 1
elavil 10mg for sleep
paxil generic
buy azithromycin no prescription
cialis in women
buy phenergan tablets
where to buy viagra online australia
lexapro.com
lasix online purchase
sildenafil 25 mg price in india
where can you buy azithromycin
allopurinol cost nz
how much is 30 lisinopril
chloroquine 200 mg
albendazole over the counter usa
medicine fluoxetine 20 mg
paxil canada
synthroid 100
0.025 mg synthroid
brand viagra from canada
buy generic synthroid online
can i buy indocin
online pharmacy com
clonidine for anxiety
generic indocin
toradol 10mg discount
kamagra jelly from india
buy prozac tablets
order amoxicillin online without prescription
prednisone over the counter in mexico
phenergan 2
plavix tablet price
gabapentin 2018
acyclovir purchase canada
buy modafinil online
modafinil 200mg
over the counter prozac uk
cost of tadalafil 5mg
Hi there! Quick question that’s totally off topic. Do you know how to make your site mobile friendly?
My web site looks weird when browsing from my iphone. I’m trying to find a theme or plugin that
might be able to fix this problem. If you have any suggestions, please share.
With thanks!
sildenafil rx coupon
generic viagra singapore
buy prednisolone 5mg online
where to buy vpxl
xenical cost south africa
celebrex 200mg
erectafil 5mg
where to buy viagra online in india
where can i buy zofran online
When I initially commented I appear to have clicked the -Notify me when new comments are
added- checkbox and from now on whenever a comment is
added I receive 4 emails with the exact same comment.
There has to be a way you can remove me from that service?
Thanks!
buy cialis online no prescription
lisinopril price uk
Its like you read my mind! You seem to know so much about this,
like you wrote the book in it or something. I think that you can do with some pics
to drive the message home a little bit, but other than that,
this is excellent blog. A fantastic read. I’ll certainly be
back.
azithromycin 2 tablets
Keep this going please, great job!
Great beat ! I would like to apprentice whilst
you amend your website, how can i subscribe for a weblog web site?
The account aided me a appropriate deal. I were a little bit familiar of this your broadcast provided brilliant transparent idea
cymbalta 60 mg capsule
paxil anxiety
buy aurogra 100
albendazole online purchase
order trazodone online
baclofen 10 mg no prescription
cost for 20 mg lisinopril
bactrim forte medicine bactrim antibiotic
Pretty section of content. I just stumbled upon your
weblog and in accession capital to assert that I acquire actually enjoyed account your blog posts.
Any way I will be subscribing to your augment and even I achievement you access consistently quickly.
clopidogrel brand name
cephalexin pharmacy
purchase plavix
purchase bupropion
buying cialis in nz
Right here is the perfect site for anyone who
hopes to find out about this topic. You realize so much its almost tough to argue with you (not that I personally will
need to…HaHa). You definitely put a new spin on a subject that’s been discussed for ages.
Great stuff, just great!
albenza drug
200g zoloft