Stubs for certain request methods?

This issue has been tracked since 2021-04-13.

I want to add different stubs for GET and POST methods on the same URL.

qs-labs wrote this answer on 2021-04-21

@sezanzeb I myself haven't gotten stubs to work but checkout the declaration for stubRequest, it supports an optional first parameter allowing you to specify the type of axios request.

marcopeg wrote this answer on 2021-06-14

By passing the method as first argument, the request will hang forever :-(

nzwsch wrote this answer on 2021-10-17

This should work.

moxios.stubRequest('/say/hello', {
  method: 'POST',
  status: 200,
  responseText: 'hello',
lior-chervinsky wrote this answer on 2022-05-29

Looks like the /dist folder isn't updated with the latest source code.

Code in dist folder:


Code in index.js:


More Details About Repo
Owner Name axios
Repo Name moxios
Full Name axios/moxios
Language JavaScript
Created Date 2016-05-25
Updated Date 2022-12-05
Star Count 1386
Watcher Count 20
Fork Count 85
Issue Count 19


Issue Title Created Date Updated Date