request.reject undefined (using typescript)

This issue has been tracked since 2019-10-10.

Following the example below from the README.de file, I'm getting request.reject equal to undefined. The only way that I was able to mock an error on the request was by using respondWith passing status 4xx. Am I doing something wrong?

moxios.wait(function () {
  let request = moxios.requests.mostRecent()
  request.reject(errorResp)
  }).catch(function (err) {
    equal(err.status, errorResp.status)
    equal(err.response.message, errorResp.response.message)
    done()
  })
})
seemranxec wrote this answer on 2019-12-10

I'm facing the same issue, did you manage to figure what was going wrong ?

yuri-gagarin wrote this answer on 2020-09-10

seems like no type definition for moxios.reject()

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

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date